pqc/tests/Makefile
hasufell 2e7ff450ef
BUILD: update PHONY
We use libpqc.a from ../src so it isn't expected to be in this
Makefile dir.
2014-06-28 02:13:21 +02:00

48 lines
934 B
Makefile

include ../common.mk
# sources, headers, objects
CUNIT_SOURCES = \
ntru_cunit.c \
ntru_file_cunit.c \
ntru_poly_cunit.c \
ntru_keypair_cunit.c \
ntru_encrypt_cunit.c \
ntru_decrypt_cunit.c
CUNIT_OBJS = $(patsubst %.c, %.o, $(CUNIT_SOURCES))
CUNIT_HEADERS = \
ntru_cunit.h
# libs
LIBS += -L. -lcunit -llz4 -lgmp -lmpfr -lflint \
$(shell $(PKG_CONFIG) --libs glib-2.0) -lm
# includes
INCS = -I. -I../include -I/usr/include/flint $(shell $(PKG_CONFIG) --cflags glib-2.0)
CFLAGS += -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED
%.o: %.c
$(CC) -fPIC $(CFLAGS) $(CPPFLAGS) $(INCS) -c $*.c
check: ntru_cunit
./ntru_cunit
test: ntru_cunit
libpqc.a:
$(MAKE) -C ../src libpqc.a
ntru_cunit: $(CUNIT_OBJS) $(CUNIT_HEADERS) libpqc.a
$(CC) $(CFLAGS) -o $@ $(CUNIT_OBJS) ../src/libpqc.a $(LDFLAGS) $(LIBS)
clean:
rm -f *.o ntru_cunit *.orig core test-file.out pub.key
.PHONY: check clean libpqc.a test