aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2018-08-28 12:36:31 +0200
committerMattias Andrée <maandree@kth.se>2018-08-28 12:36:31 +0200
commit6fda2a0697d9d49db823e1569edf27378cf31daf (patch)
tree9c088ca8932b98a33bfe92c2300d2940b5ca8353 /Makefile
parentAdd test function to all .c files (diff)
downloadlibsimple-6fda2a0697d9d49db823e1569edf27378cf31daf.tar.gz
libsimple-6fda2a0697d9d49db823e1569edf27378cf31daf.tar.bz2
libsimple-6fda2a0697d9d49db823e1569edf27378cf31daf.tar.xz
Add tests for allocation functions
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile5
1 files changed, 3 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 763ccda..505ab47 100644
--- a/Makefile
+++ b/Makefile
@@ -63,15 +63,16 @@ TESTS = $(OBJ:.o=.test)
all: libsimple.a $(TESTS)
$(OBJ): $(@:.o=.c) libsimple.h
-$(TESTS): $(@:=.o) libsimple.a
+$(TESTS): $(@:=.o) test.o libsimple.a
$(TESTS:=.o): $(@:.test.o=.c) libsimple.h test.h
+test.o: test.c libsimple.h test.h
libsimple.a: $(OBJ)
$(AR) rc $@ $?
$(AR) -s $@
.test.o.test:
- $(CC) -o $@ $< libsimple.a $(LDFLAGS)
+ $(CC) -o $@ $< libsimple.a test.o $(LDFLAGS)
.c.test.o:
$(CC) -c -o $@ $< $(CFLAGS) -DTEST