BUILD: Fix Makefiles for flint
This commit is contained in:
parent
d51d8e3652
commit
7b0a1f1920
1
Makefile
1
Makefile
@ -10,6 +10,7 @@ clean:
|
|||||||
clean-all: clean
|
clean-all: clean
|
||||||
$(MAKE) -C external/libtommath-0.42.0 clean
|
$(MAKE) -C external/libtommath-0.42.0 clean
|
||||||
$(MAKE) -C external/libtompoly-0.04 clean
|
$(MAKE) -C external/libtompoly-0.04 clean
|
||||||
|
$(MAKE) -C external/flint-2.4.3 clean
|
||||||
|
|
||||||
doc:
|
doc:
|
||||||
doxygen
|
doxygen
|
||||||
|
20
src/Makefile
20
src/Makefile
@ -34,7 +34,7 @@ else
|
|||||||
PQC_LIBS = libpqc.a
|
PQC_LIBS = libpqc.a
|
||||||
endif
|
endif
|
||||||
# CUNIT_LIBS = -lcunit
|
# CUNIT_LIBS = -lcunit
|
||||||
LIBS += -L.
|
LIBS += -L. -lgmp -lmpfr -lm
|
||||||
|
|
||||||
# objects
|
# objects
|
||||||
PQC_OBJS = rand.o poly.o mem.o ntru_decrypt.o pqc_encrypt.o
|
PQC_OBJS = rand.o poly.o mem.o ntru_decrypt.o pqc_encrypt.o
|
||||||
@ -47,10 +47,14 @@ INCS = -I.
|
|||||||
ifndef UNBUNDLE
|
ifndef UNBUNDLE
|
||||||
LIBTOMMATH = ../external/libtommath-0.42.0/libtommath.a
|
LIBTOMMATH = ../external/libtommath-0.42.0/libtommath.a
|
||||||
LIBTOMPOLY = ../external/libtompoly-0.04/libtompoly.a
|
LIBTOMPOLY = ../external/libtompoly-0.04/libtompoly.a
|
||||||
INCS += -I../external/libtommath-0.42.0 -I../external/libtompoly-0.04
|
LIBFLINT = ../external/flint-2.4.3/libflint.a
|
||||||
|
INCS += -I../external/libtommath-0.42.0 \
|
||||||
|
-I../external/libtompoly-0.04 \
|
||||||
|
-I../external/flint-2.4.3
|
||||||
else
|
else
|
||||||
LIBTOMMATH = -ltommath
|
LIBTOMMATH = -ltommath
|
||||||
LIBTOMPOLY = -ltompoly
|
LIBTOMPOLY = -ltompoly
|
||||||
|
LIBFLINT = -lflint
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
@ -69,18 +73,22 @@ $(LIBTOMMATH):
|
|||||||
|
|
||||||
$(LIBTOMPOLY):
|
$(LIBTOMPOLY):
|
||||||
$(MAKE) -C ../external/libtompoly-0.04
|
$(MAKE) -C ../external/libtompoly-0.04
|
||||||
|
|
||||||
|
$(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
|
endif
|
||||||
|
|
||||||
libpqc.a: $(PQC_OBJS) $(PQC_HEADERS)
|
libpqc.a: $(PQC_OBJS) $(PQC_HEADERS)
|
||||||
$(AR) cru libpqc.a $(PQC_OBJS)
|
$(AR) cru libpqc.a $(PQC_OBJS)
|
||||||
|
|
||||||
libpqc.so: libpqc.a $(PQC_HEADERS) $(LIBTOMMATH) $(LIBTOMPOLY)
|
libpqc.so: libpqc.a $(PQC_HEADERS) $(LIBTOMMATH) $(LIBTOMPOLY) $(LIBFLINT)
|
||||||
$(CC) -shared $(CFLAGS) -o $@ $(LDFLAGS) \
|
$(CC) -shared $(CFLAGS) -o $@ $(LDFLAGS) \
|
||||||
libpqc.a $(LIBTOMMATH) $(LIBTOMPOLY) $(LIBS)
|
libpqc.a $(LIBTOMMATH) $(LIBTOMPOLY) $(LIBFLINT) $(LIBS)
|
||||||
|
|
||||||
main: main.o libpqc.a $(LIBTOMMATH) $(LIBTOMPOLY)
|
main: main.o libpqc.a $(LIBTOMMATH) $(LIBTOMPOLY) $(LIBFLINT)
|
||||||
$(CC) $(CFLAGS) -o $@ $(LDFLAGS) \
|
$(CC) $(CFLAGS) -o $@ $(LDFLAGS) \
|
||||||
main.o $(LIBTOMPOLY) libpqc.a $(LIBTOMPOLY) $(LIBTOMMATH) $(LIBS)
|
main.o $(LIBTOMPOLY) libpqc.a $(LIBTOMPOLY) $(LIBTOMMATH) $(LIBFLINT) $(LIBS)
|
||||||
|
|
||||||
install:
|
install:
|
||||||
$(INSTALL_DIR) "$(DESTDIR)$(INSTALL_BINDIR)"
|
$(INSTALL_DIR) "$(DESTDIR)$(INSTALL_BINDIR)"
|
||||||
|
Loading…
Reference in New Issue
Block a user