Soft'N'Design Software
/
projects
/
calc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
increase test coverage
[calc.git]
/
makefile
diff --git
a/makefile
b/makefile
index f5e19b9bf3cf3464218cfbfba33ae02eb6d2366c..08034deb07d4070f32d79d5180237effb6f8b683 100644
(file)
--- a/
makefile
+++ b/
makefile
@@
-11,8
+11,8
@@
OFLAGS = -O4 -Os
#OFLAGS += -malign-double
CFLAGS += -W -Wall -Wextra -g
CFLAGS += -std=c99 -D_XOPEN_SOURCE=500
#OFLAGS += -malign-double
CFLAGS += -W -Wall -Wextra -g
CFLAGS += -std=c99 -D_XOPEN_SOURCE=500
-CFLAGS += $(OFLAGS) $(INCLUDES) $(GCOV
ER
)
-LDFLAGS += -g
+CFLAGS += $(OFLAGS) $(INCLUDES) $(GCOV)
+LDFLAGS += -g
$(GCOV)
# Targets
# Targets
@@
-24,6
+24,7
@@
SHELL = bash
#MAKE = mingw32-make
MAKEFLAGS += -s
#MAKE = mingw32-make
MAKEFLAGS += -s
+include $(wildcard .makefile)
# Functions
# Functions
@@
-69,7
+70,7
@@
valgrinds:
wipe: purge
$(call TITLE, "Wiping")
touch wipe
wipe: purge
$(call TITLE, "Wiping")
touch wipe
- rm -f wipe $(wildcard *.gcda *.gcno)
+ rm -f wipe $(wildcard *.gcda *.gcno
*.gcov
)
$(call PASS, SUCCESS)
tests: all
$(call PASS, SUCCESS)
tests: all
@@
-82,7
+83,7
@@
include $(wildcard *.ld)
gcov_%:
$(MAKE) purge
gcov_%:
$(MAKE) purge
-
CFLAGS="-fprofile-arcs -ftest-coverage" LDFLAGS="-fprofile-arcs -ftest-coverage
" $(MAKE)
+
GCOV="-fprofile-arcs -ftest-coverage -O0
" $(MAKE)
$(MAKE) test_$(@:gcov_%=%)
gcov `sed -e 's/\.exe:/.c/;s/\.o/.c/g' $(@:gcov_%=%.ld)`
touch gcov
$(MAKE) test_$(@:gcov_%=%)
gcov `sed -e 's/\.exe:/.c/;s/\.o/.c/g' $(@:gcov_%=%.ld)`
touch gcov
@@
-103,7
+104,7
@@
test_%: %.test %.exe
[ $$? -eq 0 ] && echo -e "\033[1;32mSUCCESS\033[0;0m" \
|| { echo -e "\033[1;31mFAILED\033[0;0m"; RC=1; }; \
done; \
[ $$? -eq 0 ] && echo -e "\033[1;32mSUCCESS\033[0;0m" \
|| { echo -e "\033[1;31mFAILED\033[0;0m"; RC=1; }; \
done; \
- test "$$RC" -ne 1
+ test "$$RC" -ne 1
valgrind_%: %.exe
VALGRIND="valgrind -v --leak-check=full --show-reachable=yes --log-fd=2"; \
valgrind_%: %.exe
VALGRIND="valgrind -v --leak-check=full --show-reachable=yes --log-fd=2"; \