diff options
| author | J08nY | 2017-08-29 16:59:14 +0200 |
|---|---|---|
| committer | J08nY | 2017-08-29 16:59:14 +0200 |
| commit | 3e9be5f5db1bccb5eb11d51cf615182eb394afb6 (patch) | |
| tree | 93977fbc769daaf1b89620753070e4f408b7bf41 /test/src/Makefile | |
| parent | f98b11a252ca227cf0376a3cd7cf1d69f6686385 (diff) | |
| parent | 4b5d03eda289aa477e693cad8b598a398bb7e04c (diff) | |
| download | ecgen-3e9be5f5db1bccb5eb11d51cf615182eb394afb6.tar.gz ecgen-3e9be5f5db1bccb5eb11d51cf615182eb394afb6.tar.zst ecgen-3e9be5f5db1bccb5eb11d51cf615182eb394afb6.zip | |
Merge branch 'unit-tests-criterion'
Diffstat (limited to 'test/src/Makefile')
| -rw-r--r-- | test/src/Makefile | 42 |
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 {} + |
