Mercurial > dropbear
annotate libtommath/makefile_include.mk @ 1545:0b991dec7ab9 coverity
merge coverity
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Mon, 26 Feb 2018 22:43:12 +0800 |
parents | 47fcbdd12d9b |
children | f52919ffd3b1 |
rev | line source |
---|---|
1470 | 1 # |
2 # Include makefile for libtommath | |
3 # | |
4 | |
5 #version of library | |
6 VERSION=1.0.1 | |
7 VERSION_PC=1.0.1 | |
8 VERSION_SO=1:1 | |
9 | |
10 PLATFORM := $(shell uname | sed -e 's/_.*//') | |
11 | |
12 # default make target | |
13 default: ${LIBNAME} | |
14 | |
15 # Compiler and Linker Names | |
16 ifndef CROSS_COMPILE | |
17 CROSS_COMPILE= | |
18 endif | |
19 | |
1522
47fcbdd12d9b
Remove bad merged libtommmath "clean" rule and leftover makefile.include
Matt Johnston <matt@ucc.asn.au>
parents:
1470
diff
changeset
|
20 # Dropbear passes these down |
47fcbdd12d9b
Remove bad merged libtommmath "clean" rule and leftover makefile.include
Matt Johnston <matt@ucc.asn.au>
parents:
1470
diff
changeset
|
21 #ifeq ($(CC),cc) |
47fcbdd12d9b
Remove bad merged libtommmath "clean" rule and leftover makefile.include
Matt Johnston <matt@ucc.asn.au>
parents:
1470
diff
changeset
|
22 # CC = $(CROSS_COMPILE)gcc |
47fcbdd12d9b
Remove bad merged libtommmath "clean" rule and leftover makefile.include
Matt Johnston <matt@ucc.asn.au>
parents:
1470
diff
changeset
|
23 #endif |
47fcbdd12d9b
Remove bad merged libtommmath "clean" rule and leftover makefile.include
Matt Johnston <matt@ucc.asn.au>
parents:
1470
diff
changeset
|
24 #LD=$(CROSS_COMPILE)ld |
47fcbdd12d9b
Remove bad merged libtommmath "clean" rule and leftover makefile.include
Matt Johnston <matt@ucc.asn.au>
parents:
1470
diff
changeset
|
25 #AR=$(CROSS_COMPILE)ar |
47fcbdd12d9b
Remove bad merged libtommmath "clean" rule and leftover makefile.include
Matt Johnston <matt@ucc.asn.au>
parents:
1470
diff
changeset
|
26 #RANLIB=$(CROSS_COMPILE)ranlib |
1470 | 27 |
28 ifndef MAKE | |
29 MAKE=make | |
30 endif | |
31 | |
32 CFLAGS += -I./ -Wall -Wsign-compare -Wextra -Wshadow | |
33 | |
34 ifndef NO_ADDTL_WARNINGS | |
35 # additional warnings | |
36 CFLAGS += -Wsystem-headers -Wdeclaration-after-statement -Wbad-function-cast -Wcast-align | |
37 CFLAGS += -Wstrict-prototypes -Wpointer-arith | |
38 endif | |
39 | |
40 ifdef COMPILE_DEBUG | |
41 #debug | |
42 CFLAGS += -g3 | |
43 else | |
44 | |
45 ifdef COMPILE_SIZE | |
46 #for size | |
47 CFLAGS += -Os | |
48 else | |
49 | |
50 ifndef IGNORE_SPEED | |
51 #for speed | |
52 CFLAGS += -O3 -funroll-loops | |
53 | |
54 #x86 optimizations [should be valid for any GCC install though] | |
55 CFLAGS += -fomit-frame-pointer | |
56 endif | |
57 | |
58 endif # COMPILE_SIZE | |
59 endif # COMPILE_DEBUG | |
60 | |
61 ifneq ($(findstring clang,$(CC)),) | |
62 CFLAGS += -Wno-typedef-redefinition -Wno-tautological-compare -Wno-builtin-requires-header | |
63 endif | |
64 ifeq ($(PLATFORM), Darwin) | |
65 CFLAGS += -Wno-nullability-completeness | |
66 endif | |
67 | |
68 # adjust coverage set | |
69 ifneq ($(filter $(shell arch), i386 i686 x86_64 amd64 ia64),) | |
70 COVERAGE = test_standalone timing | |
71 COVERAGE_APP = ./test && ./ltmtest | |
72 else | |
73 COVERAGE = test_standalone | |
74 COVERAGE_APP = ./test | |
75 endif | |
76 | |
77 HEADERS_PUB=tommath.h tommath_class.h tommath_superclass.h | |
78 HEADERS=tommath_private.h $(HEADERS_PUB) | |
79 | |
80 test_standalone: CFLAGS+=-DLTM_DEMO_TEST_VS_MTEST=0 | |
81 | |
82 #LIBPATH The directory for libtommath to be installed to. | |
83 #INCPATH The directory to install the header files for libtommath. | |
84 #DATAPATH The directory to install the pdf docs. | |
85 DESTDIR ?= | |
86 PREFIX ?= /usr/local | |
87 LIBPATH ?= $(PREFIX)/lib | |
88 INCPATH ?= $(PREFIX)/include | |
89 DATAPATH ?= $(PREFIX)/share/doc/libtommath/pdf | |
90 | |
91 #make the code coverage of the library | |
92 # | |
93 coverage: CFLAGS += -fprofile-arcs -ftest-coverage -DTIMING_NO_LOGS | |
94 coverage: LFLAGS += -lgcov | |
95 coverage: LDFLAGS += -lgcov | |
96 | |
97 coverage: $(COVERAGE) | |
98 $(COVERAGE_APP) | |
99 | |
100 lcov: coverage | |
101 rm -f coverage.info | |
102 lcov --capture --no-external --no-recursion $(LCOV_ARGS) --output-file coverage.info -q | |
103 genhtml coverage.info --output-directory coverage -q | |
104 | |
105 # target that removes all coverage output | |
106 cleancov-clean: | |
107 rm -f `find . -type f -name "*.info" | xargs` | |
108 rm -rf coverage/ | |
109 | |
110 # cleans everything - coverage output and standard 'clean' | |
111 cleancov: cleancov-clean clean | |
112 | |
113 clean: | |
114 rm -f *.gcda *.gcno *.gcov *.bat *.o *.a *.obj *.lib *.exe *.dll etclib/*.o demo/demo.o test ltmtest mpitest mtest/mtest mtest/mtest.exe \ | |
115 *.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 | |
116 rm -rf .libs/ | |
1522
47fcbdd12d9b
Remove bad merged libtommmath "clean" rule and leftover makefile.include
Matt Johnston <matt@ucc.asn.au>
parents:
1470
diff
changeset
|
117 #${MAKE} -C etc/ clean MAKE=${MAKE} |
47fcbdd12d9b
Remove bad merged libtommmath "clean" rule and leftover makefile.include
Matt Johnston <matt@ucc.asn.au>
parents:
1470
diff
changeset
|
118 #${MAKE} -C doc/ clean MAKE=${MAKE} |