From 69a6f1516f41a842d5cec59869ca15f41fbc6a47 Mon Sep 17 00:00:00 2001 From: jmjatlanta Date: Thu, 8 Dec 2016 16:42:08 -0500 Subject: [PATCH] Moved tests to seperate directory --- Makefile | 9 +++++---- test/Makefile | 19 +++++++++++++++++++ Test1_protobuf.c => test/Test1_protobuf.c | 0 Test1_protobuf.h => test/Test1_protobuf.h | 0 Test2_protobuf.c => test/Test2_protobuf.c | 0 Test2_protobuf.h => test/Test2_protobuf.h | 0 test_protobuf.h => test/test_protobuf.h | 0 test_varint.h => test/test_varint.h | 0 testit.c => test/testit.c | 0 9 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 test/Makefile rename Test1_protobuf.c => test/Test1_protobuf.c (100%) rename Test1_protobuf.h => test/Test1_protobuf.h (100%) rename Test2_protobuf.c => test/Test2_protobuf.c (100%) rename Test2_protobuf.h => test/Test2_protobuf.h (100%) rename test_protobuf.h => test/test_protobuf.h (100%) rename test_varint.h => test/test_varint.h (100%) rename testit.c => test/testit.c (100%) diff --git a/Makefile b/Makefile index a65253d..55764d7 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ CC = gcc CFLAGS = -O0 -g3 -Wall LFLAGS = DEPS = protobuf.h -OBJS = testit.o protobuf.o varint.o Test1_protobuf.o Test2_protobuf.o +OBJS = protobuf.o varint.o %.o: %.c $(DEPS) $(CC) -c -o $@ $< $(CFLAGS) @@ -10,10 +10,11 @@ OBJS = testit.o protobuf.o varint.o Test1_protobuf.o Test2_protobuf.o test_protobuf: $(OBJS) $(CC) -o $@ $^ $(LFLAGS) -all: test_protobuf - +all: $(OBJS) + cd test; make all; + clean: rm -f *.o - rm -f test_protobuf + cd test; make clean; rebuild: clean all \ No newline at end of file diff --git a/test/Makefile b/test/Makefile new file mode 100644 index 0000000..25b5a72 --- /dev/null +++ b/test/Makefile @@ -0,0 +1,19 @@ +CC = gcc +CFLAGS = -O0 -g3 -Wall -I../ +LFLAGS = +DEPS = ../protobuf.h +OBJS = testit.o ../protobuf.o ../varint.o Test1_protobuf.o Test2_protobuf.o + +%.o: %.c $(DEPS) + $(CC) -c -o $@ $< $(CFLAGS) + +test_protobuf: $(OBJS) + $(CC) -o $@ $^ $(LFLAGS) + +all: test_protobuf + +clean: + rm -f *.o + rm -f test_protobuf + +rebuild: clean all \ No newline at end of file diff --git a/Test1_protobuf.c b/test/Test1_protobuf.c similarity index 100% rename from Test1_protobuf.c rename to test/Test1_protobuf.c diff --git a/Test1_protobuf.h b/test/Test1_protobuf.h similarity index 100% rename from Test1_protobuf.h rename to test/Test1_protobuf.h diff --git a/Test2_protobuf.c b/test/Test2_protobuf.c similarity index 100% rename from Test2_protobuf.c rename to test/Test2_protobuf.c diff --git a/Test2_protobuf.h b/test/Test2_protobuf.h similarity index 100% rename from Test2_protobuf.h rename to test/Test2_protobuf.h diff --git a/test_protobuf.h b/test/test_protobuf.h similarity index 100% rename from test_protobuf.h rename to test/test_protobuf.h diff --git a/test_varint.h b/test/test_varint.h similarity index 100% rename from test_varint.h rename to test/test_varint.h diff --git a/testit.c b/test/testit.c similarity index 100% rename from testit.c rename to test/testit.c