makefile: improve a bit more - add make targets for coverage creation - don't enable optimization when requesting a debug build
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
diff --git a/.gitignore b/.gitignore
index aef5fcb..8f27df2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,6 +10,8 @@ Debug/
Release/
.libs/
.coveralls.yml
+coverage/
+coverage.info
# suppress output of build process and *nix/windows test executables
ltmtest
diff --git a/makefile b/makefile
index c4043ac..e8feb7f 100644
--- a/makefile
+++ b/makefile
@@ -88,6 +88,13 @@ coverage: LFLAGS += -lgcov
coverage: test_standalone
./test
+lcov: coverage
+ lcov --capture --no-external --no-recursion --directory . --output-file coverage.info -q
+ genhtml coverage.info --output-directory coverage -q
+
+coveralls: coverage
+ cpp-coveralls
+
#make a profiled library (takes a while!!!)
#
# This will build the library with profile generation
diff --git a/makefile.include b/makefile.include
index edb39c5..a6c5a66 100644
--- a/makefile.include
+++ b/makefile.include
@@ -26,6 +26,16 @@ CFLAGS += -Wsystem-headers -Wdeclaration-after-statement -Wbad-function-cast -Wc
CFLAGS += -Wstrict-prototypes -Wpointer-arith
endif
+ifdef COMPILE_DEBUG
+#debug
+CFLAGS += -g3
+else
+
+ifdef COMPILE_SIZE
+#for size
+CFLAGS += -Os
+else
+
ifndef IGNORE_SPEED
#for speed
CFLAGS += -O3 -funroll-loops
@@ -34,15 +44,8 @@ CFLAGS += -O3 -funroll-loops
CFLAGS += -fomit-frame-pointer
endif
-ifdef COMPILE_SIZE
-#for size
-CFLAGS += -Os
-endif
-
-ifdef COMPILE_DEBUG
-#debug
-CFLAGS += -g3
-endif
+endif # COMPILE_SIZE
+endif # COMPILE_DEBUG
HEADERS=tommath.h tommath_class.h tommath_superclass.h