2014-12-14 13:43:50 -05:00
|
|
|
#
|
|
|
|
# Include makefile for libtommath
|
|
|
|
#
|
|
|
|
|
2015-12-12 14:19:15 -05:00
|
|
|
#version of library
|
|
|
|
VERSION=0.43.0
|
|
|
|
VERSION_SO=0:43
|
|
|
|
|
|
|
|
# default make target
|
|
|
|
default: ${LIBNAME}
|
|
|
|
|
2015-04-18 07:58:17 -04:00
|
|
|
# Compiler and Linker Names
|
|
|
|
ifndef PREFIX
|
|
|
|
PREFIX=
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(CC),cc)
|
|
|
|
CC = $(PREFIX)gcc
|
|
|
|
endif
|
|
|
|
LD=$(PREFIX)ld
|
|
|
|
AR=$(PREFIX)ar
|
|
|
|
RANLIB=$(PREFIX)ranlib
|
|
|
|
|
|
|
|
ifndef MAKE
|
|
|
|
MAKE=make
|
|
|
|
endif
|
|
|
|
|
2015-10-30 17:45:34 -04:00
|
|
|
CFLAGS += -I./ -Wall -Wsign-compare -Wextra -Wshadow
|
2014-12-14 13:43:50 -05:00
|
|
|
|
|
|
|
ifndef NO_ADDTL_WARNINGS
|
|
|
|
# additional warnings
|
|
|
|
CFLAGS += -Wsystem-headers -Wdeclaration-after-statement -Wbad-function-cast -Wcast-align
|
|
|
|
CFLAGS += -Wstrict-prototypes -Wpointer-arith
|
|
|
|
endif
|
|
|
|
|
2015-04-26 09:22:49 -04:00
|
|
|
ifdef COMPILE_DEBUG
|
|
|
|
#debug
|
|
|
|
CFLAGS += -g3
|
|
|
|
else
|
|
|
|
|
|
|
|
ifdef COMPILE_SIZE
|
|
|
|
#for size
|
|
|
|
CFLAGS += -Os
|
|
|
|
else
|
|
|
|
|
2014-12-14 13:43:50 -05:00
|
|
|
ifndef IGNORE_SPEED
|
|
|
|
#for speed
|
|
|
|
CFLAGS += -O3 -funroll-loops
|
|
|
|
|
|
|
|
#x86 optimizations [should be valid for any GCC install though]
|
|
|
|
CFLAGS += -fomit-frame-pointer
|
|
|
|
endif
|
|
|
|
|
2015-04-26 09:22:49 -04:00
|
|
|
endif # COMPILE_SIZE
|
|
|
|
endif # COMPILE_DEBUG
|
2014-12-14 13:43:50 -05:00
|
|
|
|
2015-11-11 20:02:18 -05:00
|
|
|
HEADERS_PUB=tommath.h tommath_class.h tommath_superclass.h
|
|
|
|
HEADERS=tommath_private.h $(HEADERS_PUB)
|
2014-12-14 13:43:50 -05:00
|
|
|
|
2015-04-18 07:58:17 -04:00
|
|
|
test_standalone: CFLAGS+=-DLTM_DEMO_TEST_VS_MTEST=0
|
2014-12-14 13:43:50 -05:00
|
|
|
|
2015-11-11 20:02:18 -05:00
|
|
|
#LIBPATH-The directory for libtommath to be installed to.
|
|
|
|
#INCPATH-The directory to install the header files for libtommath.
|
|
|
|
#DATAPATH-The directory to install the pdf docs.
|
|
|
|
LIBPATH?=/usr/lib
|
|
|
|
INCPATH?=/usr/include
|
|
|
|
DATAPATH?=/usr/share/doc/libtommath/pdf
|
2014-12-14 13:43:50 -05:00
|
|
|
|
2015-12-12 14:19:15 -05:00
|
|
|
#make the code coverage of the library
|
|
|
|
#
|
|
|
|
coverage: CFLAGS += -fprofile-arcs -ftest-coverage -DTIMING_NO_LOGS
|
|
|
|
coverage: LFLAGS += -lgcov
|
|
|
|
coverage: LDFLAGS += -lgcov
|
|
|
|
|
|
|
|
coverage: test_standalone timing
|
|
|
|
./test
|
|
|
|
./ltmtest
|
|
|
|
|
|
|
|
lcov: coverage
|
|
|
|
rm -f coverage.info
|
|
|
|
lcov --capture --no-external --no-recursion $(LCOV_ARGS) --output-file coverage.info -q
|
|
|
|
genhtml coverage.info --output-directory coverage -q
|
|
|
|
|
|
|
|
coveralls: coverage
|
|
|
|
cpp-coveralls
|
|
|
|
|
|
|
|
# target that removes all coverage output
|
|
|
|
cleancov-clean:
|
|
|
|
rm -f `find . -type f -name "*.info" | xargs`
|
|
|
|
rm -rf coverage/
|
|
|
|
|
|
|
|
# cleans everything - coverage output and standard 'clean'
|
|
|
|
cleancov: cleancov-clean clean
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f *.gcda *.gcno *.bat *.o *.a *.obj *.lib *.exe *.dll etclib/*.o demo/demo.o test ltmtest 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/
|
|
|
|
cd etc ; MAKE=${MAKE} ${MAKE} clean
|
|
|
|
cd pics ; MAKE=${MAKE} ${MAKE} clean
|