summaryrefslogtreecommitdiff
path: root/libtommath/makefile_include.mk
diff options
context:
space:
mode:
Diffstat (limited to 'libtommath/makefile_include.mk')
-rw-r--r--libtommath/makefile_include.mk72
1 files changed, 44 insertions, 28 deletions
diff --git a/libtommath/makefile_include.mk b/libtommath/makefile_include.mk
index e39aa1e..ceb2d44 100644
--- a/libtommath/makefile_include.mk
+++ b/libtommath/makefile_include.mk
@@ -3,9 +3,9 @@
#
#version of library
-VERSION=1.1.0
-VERSION_PC=1.1.0
-VERSION_SO=2:0:1
+VERSION=1.2.0
+VERSION_PC=1.2.0
+VERSION_SO=3:0:2
PLATFORM := $(shell uname | sed -e 's/_.*//')
@@ -48,52 +48,71 @@ else
endif
endif
-CFLAGS += -I./ -Wall -Wsign-compare -Wextra -Wshadow
+LTM_CFLAGS += -I./ -Wall -Wsign-compare -Wextra -Wshadow
+
+ifdef SANITIZER
+LTM_CFLAGS += -fsanitize=undefined -fno-sanitize-recover=all -fno-sanitize=float-divide-by-zero
+endif
ifndef NO_ADDTL_WARNINGS
# additional warnings
-CFLAGS += -Wsystem-headers -Wdeclaration-after-statement -Wbad-function-cast -Wcast-align
-CFLAGS += -Wstrict-prototypes -Wpointer-arith
+LTM_CFLAGS += -Wdeclaration-after-statement -Wbad-function-cast -Wcast-align
+LTM_CFLAGS += -Wstrict-prototypes -Wpointer-arith
+endif
+
+ifdef CONV_WARNINGS
+LTM_CFLAGS += -std=c89 -Wconversion -Wsign-conversion
+ifeq ($(CONV_WARNINGS), strict)
+LTM_CFLAGS += -DMP_USE_ENUMS -Wc++-compat
+endif
+else
+LTM_CFLAGS += -Wsystem-headers
endif
ifdef COMPILE_DEBUG
#debug
-CFLAGS += -g3
-else
+LTM_CFLAGS += -g3
+endif
ifdef COMPILE_SIZE
#for size
-CFLAGS += -Os
+LTM_CFLAGS += -Os
else
ifndef IGNORE_SPEED
#for speed
-CFLAGS += -O3 -funroll-loops
+LTM_CFLAGS += -O3 -funroll-loops
#x86 optimizations [should be valid for any GCC install though]
-CFLAGS += -fomit-frame-pointer
+LTM_CFLAGS += -fomit-frame-pointer
endif
endif # COMPILE_SIZE
-endif # COMPILE_DEBUG
ifneq ($(findstring clang,$(CC)),)
-CFLAGS += -Wno-typedef-redefinition -Wno-tautological-compare -Wno-builtin-requires-header
+LTM_CFLAGS += -Wno-typedef-redefinition -Wno-tautological-compare -Wno-builtin-requires-header
endif
ifneq ($(findstring mingw,$(CC)),)
-CFLAGS += -Wno-shadow
+LTM_CFLAGS += -Wno-shadow
endif
ifeq ($(PLATFORM), Darwin)
-CFLAGS += -Wno-nullability-completeness
+LTM_CFLAGS += -Wno-nullability-completeness
endif
ifeq ($(PLATFORM), CYGWIN)
LIBTOOLFLAGS += -no-undefined
endif
+# add in the standard FLAGS
+LTM_CFLAGS += $(CFLAGS)
+LTM_LFLAGS += $(LFLAGS)
+LTM_LDFLAGS += $(LDFLAGS)
+LTM_LIBTOOLFLAGS += $(LIBTOOLFLAGS)
+
+
ifeq ($(PLATFORM),FreeBSD)
_ARCH := $(shell sysctl -b hw.machine_arch)
else
- _ARCH := $(shell arch)
+ _ARCH := $(shell uname -m)
endif
# adjust coverage set
@@ -105,10 +124,8 @@ else
COVERAGE_APP = ./test
endif
-HEADERS_PUB=tommath.h tommath_class.h tommath_superclass.h
-HEADERS=tommath_private.h $(HEADERS_PUB)
-
-test_standalone: CFLAGS+=-DLTM_DEMO_TEST_VS_MTEST=0
+HEADERS_PUB=tommath.h
+HEADERS=tommath_private.h tommath_class.h tommath_superclass.h tommath_cutoffs.h $(HEADERS_PUB)
#LIBPATH The directory for libtommath to be installed to.
#INCPATH The directory to install the header files for libtommath.
@@ -121,9 +138,9 @@ DATAPATH ?= $(PREFIX)/share/doc/libtommath/pdf
#make the code coverage of the library
#
-coverage: CFLAGS += -fprofile-arcs -ftest-coverage -DTIMING_NO_LOGS
-coverage: LFLAGS += -lgcov
-coverage: LDFLAGS += -lgcov
+coverage: LTM_CFLAGS += -fprofile-arcs -ftest-coverage -DTIMING_NO_LOGS
+coverage: LTM_LFLAGS += -lgcov
+coverage: LTM_LDFLAGS += -lgcov
coverage: $(COVERAGE)
$(COVERAGE_APP)
@@ -142,8 +159,7 @@ cleancov-clean:
cleancov: cleancov-clean clean
clean:
- rm -f *.gcda *.gcno *.gcov *.bat *.o *.a *.obj *.lib *.exe *.dll etclib/*.o demo/demo.o test timing mpitest mtest/mtest mtest/mtest.exe \
- *.idx *.toc *.log *.aux *.dvi *.lof *.ind *.ilg *.ps *.log *.s mpi.c *.da *.dyn *.dpi tommath.tex `find . -type f | grep [~] | xargs` *.lo *.la
- rm -rf .libs/
-# ${MAKE} -C etc/ clean MAKE=${MAKE}
-# ${MAKE} -C doc/ clean MAKE=${MAKE}
+ rm -f *.gcda *.gcno *.gcov *.bat *.o *.a *.obj *.lib *.exe *.dll etclib/*.o \
+ demo/*.o test timing mtest_opponent mtest/mtest mtest/mtest.exe tuning_list \
+ *.s mpi.c *.da *.dyn *.dpi tommath.tex `find . -type f | grep [~] | xargs` *.lo *.la
+ rm -rf .libs/ demo/.libs