aboutsummaryrefslogtreecommitdiff
path: root/tests/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Makefile')
-rw-r--r--tests/Makefile28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/Makefile b/tests/Makefile
new file mode 100644
index 0000000..dc5e0c5
--- /dev/null
+++ b/tests/Makefile
@@ -0,0 +1,28 @@
+CC=gcc
+CFLAGS=-Wall -O3 -g -rdynamic -DNDEBUG $(OPTFLAGS)
+INCLUDE=-I../include/ -I./include
+LIB=-L../lib
+
+override LDFLAGS+=-lgensvm -lm
+
+TEST_SRC=$(wildcard src/test_*.c)
+TESTS=$(patsubst src/%.c,bin/%,$(TEST_SRC))
+
+.PHONY: all
+
+all: $(TESTS)
+ bash ./runtests.sh
+
+bin/%: src/%.c
+ @echo $<
+ @$(CC) $< -o $@ $(CFLAGS) $(INCLUDE) $(LIB) $(LDFLAGS)
+
+valgrind:
+ VALGRIND="valgrind --error-limit=no --leak-check=full \
+ --log-file=/tmp/valgrind-%p.log --track-origins=yes \
+ --show-leak-kinds=all -v" $(MAKE)
+
+clean:
+ rm -rf $(TESTS)
+ rm -f ./tests.log
+ rm -f /tmp/valgrind*.log