diff --git a/Makefile b/Makefile index a11196e..7562cd9 100644 --- a/Makefile +++ b/Makefile @@ -10,9 +10,6 @@ main: clean: $(MAKE) -C src clean -clean-all: clean - $(MAKE) -C external/flint-2.4.3 clean - doc: doxygen @@ -20,4 +17,4 @@ doc-pdf: doc $(MAKE) -C latex pdf -.PHONY: clean clean-all doc doc-pdf +.PHONY: clean doc doc-pdf diff --git a/common.mk b/common.mk index 759b692..db27a46 100644 --- a/common.mk +++ b/common.mk @@ -9,13 +9,6 @@ ifeq ($(shell $(CC) -v 2>&1 | grep 'gcc version' &>/dev/null && echo 1),1) CFLAGS += -Wno-unused-but-set-variable endif LDFLAGS ?= -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -# ifndef NOSTATIC -# LDFLAGS += -static -# endif - -ifndef NODEBUG -CFLAGS += -O0 -g3 -endif # install variables INSTALL = install diff --git a/src/Makefile b/src/Makefile index 8064d38..4590764 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,16 +1,6 @@ include ../common.mk -# libs -ifdef SHARED_LIB -PQC_LIBS = libpqc.so -else -PQC_LIBS = libpqc.a -endif -# CUNIT_LIBS = -lcunit -LIBS += -L. -lgmp -lmpfr -lm $(shell $(PKG_CONFIG) --libs glib-2.0) - - # sources, headers, objects PQC_SOURCES = poly.c \ mem.c \ @@ -34,16 +24,11 @@ PQC_HEADERS = err.h \ file.h \ ntru_string.h -# includes -INCS = -I. $(shell $(PKG_CONFIG) --cflags glib-2.0) +# libs +LIBS += -L. -lgmp -lmpfr -lflint $(shell $(PKG_CONFIG) --libs glib-2.0) -lm -ifndef UNBUNDLE -LIBFLINT = ../external/flint-2.4.3/libflint.a -INCS += -I../external/flint-2.4.3 -else -LIBFLINT = -lflint -INCS += -I/usr/include/flint -endif +# includes +INCS = -I. -I/usr/include/flint $(shell $(PKG_CONFIG) --cflags glib-2.0) %.o: %.c @@ -51,16 +36,6 @@ endif all: libpqc.a libpqc.so - -# test: $(CUNIT_OBJS) $(PQC_LIBS) - # $(CC) $(CFLAGS) -o $@ $(CUNIT_OBJS) $(LDFLAGS) $(CUNIT_LIBS) $(PQC_LIBS) $(LIBS) - -ifndef UNBUNDLE -$(LIBFLINT): - cd ../external/flint-2.4.3 && ./configure --prefix=/usr --with-gmp=/usr --with-mpfr=/usr --disable-shared - $(MAKE) -C ../external/flint-2.4.3 -endif - libpqc.a: $(PQC_OBJS) $(PQC_HEADERS) $(AR) cru libpqc.a $(PQC_OBJS) @@ -80,11 +55,8 @@ install: uninstall: [ -e "$(DESTDIR)$(INSTALL_LIBDIR)/libpqc.so" ] && rm "$(DESTDIR)$(INSTALL_LIBDIR)/libpqc.so" -# check: - # ./test - clean: rm -f *.o test libpqc.a libpqc.so main -.PHONY: clean install +.PHONY: clean install uninstall