aboutsummaryrefslogtreecommitdiff
path: root/test/src/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'test/src/Makefile')
-rw-r--r--test/src/Makefile42
1 files changed, 42 insertions, 0 deletions
diff --git a/test/src/Makefile b/test/src/Makefile
new file mode 100644
index 0000000..27e6ea2
--- /dev/null
+++ b/test/src/Makefile
@@ -0,0 +1,42 @@
+####
+#
+# ecgen, tool for generating Elliptic curve domain parameters
+# Copyright (C) 2017 J08nY
+#
+####
+
+
+CC ?= gcc
+CFLAGS = -Wall
+TEST ?= 0
+ifeq ($(TEST), 1)
+ CFLAGS += --coverage -g -O0
+endif
+LDFLAGS = -L../../lib/parson -L../../lib/sha1 -L../../lib/pari -L../lib/criterion/build
+INCLUDES = -I. -I../../src -I../../lib -I../lib/criterion/include
+LIBS = -lrt -lpari -lpthread -lparson -lsha1 -lcriterion
+
+TEST_SRC = $(wildcard *.c) $(wildcard */*.c)
+TEST_OBJ = $(patsubst %.c,%.o, $(TEST_SRC))
+TESTS = $(patsubst %.c,%, $(TEST_SRC))
+
+ECGEN_SRC = $(wildcard ../../src/*/*.c)
+ECGEN_OBJ = $(patsubst %.c,%.o, $(ECGEN_SRC))
+
+all: test_ecgen
+ LD_LIBRARY_PATH=../lib/criterion/build ./test_ecgen
+
+test_ecgen: $(TEST_OBJ) $(ECGEN_OBJ)
+ $(CC) $(CFLAGS) $(INCLUDES) -o $@ $^ $(LDFLAGS) $(LIBS)
+
+%.o: %.c
+ $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $<
+
+clean-all: clean
+ rm -f ./test_ecgen
+
+clean:
+ find . -type f -name '*.o' -exec rm {} +
+ find . -type f -name '*.gcda' -exec rm {} +
+ find . -type f -name '*.gcno' -exec rm {} +
+ find . -type f -name '*.gcov' -exec rm {} +