diff --git a/Makefile b/src/Makefile similarity index 68% rename from Makefile rename to src/Makefile index 207b4e3..ec8b689 100644 --- a/Makefile +++ b/src/Makefile @@ -1,10 +1,8 @@ CC = gcc -CLIENT = iodine +CLIENT = ../bin/iodine CLIENTOBJS = iodine.o tun.o dns.o read.o encoding.o -SERVER = iodined +SERVER = ../bin/iodined SERVEROBJS = iodined.o tun.o dns.o read.o encoding.o -TESTSUITE = tester -TESTOBJS = test.o dns.o read.o encoding.o OS = `uname | tr "a-z" "A-Z"` @@ -13,26 +11,19 @@ CFLAGS = -c -g -Wall -D$(OS) all: stateos $(CLIENT) $(SERVER) $(TESTSUITE) -test: $(TESTSUITE) - @./$(TESTSUITE) - stateos: @echo OS is $(OS) $(CLIENT): $(CLIENTOBJS) @echo LD $@ + @mkdir -p ../bin @$(CC) $(CLIENTOBJS) -o $(CLIENT) $(LDFLAGS) $(SERVER): $(SERVEROBJS) @echo LD $@ + @mkdir -p ../bin @$(CC) $(SERVEROBJS) -o $(SERVER) $(LDFLAGS) -$(TESTSUITE): $(TESTOBJS) - @echo LD $@ - @$(CC) $(TESTOBJS) -o $(TESTSUITE) $(LDFLAGS) - @echo Running tests... - @./$(TESTSUITE) - .c.o: @echo CC $< @$(CC) $(CFLAGS) $< -o $@ diff --git a/dns.c b/src/dns.c similarity index 100% rename from dns.c rename to src/dns.c diff --git a/dns.h b/src/dns.h similarity index 100% rename from dns.h rename to src/dns.h diff --git a/encoding.c b/src/encoding.c similarity index 100% rename from encoding.c rename to src/encoding.c diff --git a/encoding.h b/src/encoding.h similarity index 100% rename from encoding.h rename to src/encoding.h diff --git a/iodine.c b/src/iodine.c similarity index 100% rename from iodine.c rename to src/iodine.c diff --git a/iodined.c b/src/iodined.c similarity index 100% rename from iodined.c rename to src/iodined.c diff --git a/read.c b/src/read.c similarity index 100% rename from read.c rename to src/read.c diff --git a/read.h b/src/read.h similarity index 100% rename from read.h rename to src/read.h diff --git a/structs.h b/src/structs.h similarity index 100% rename from structs.h rename to src/structs.h diff --git a/tun.c b/src/tun.c similarity index 100% rename from tun.c rename to src/tun.c diff --git a/tun.h b/src/tun.h similarity index 100% rename from tun.h rename to src/tun.h diff --git a/test.c b/tests/test.c similarity index 100% rename from test.c rename to tests/test.c