correct a test
[calc.git] / makefile
index 25ebdc02b5414be51ec60da4609e689ddbfc587a..73ea86ea5b12a145f33f69cafa8aa33a39b76b6b 100644 (file)
--- a/makefile
+++ b/makefile
@@ -64,7 +64,7 @@ purge: clean
        rm -f purge $(ALLEXE:%=%.exe)
        $(call PASS, SUCCESS)
 
-valgrinds:
+valgrinds: all
        $(MAKE) $(addprefix valgrind_,$(ALLEXE))
 
 wipe: purge
@@ -83,17 +83,18 @@ include $(wildcard *.ld)
 
 gcov_%:
        $(MAKE) purge
-       GCOV="-fprofile-arcs -ftest-coverage -O0" $(MAKE)
+       GCOV="-coverage -O0" $(MAKE)
        $(MAKE) test_$(@:gcov_%=%)
        gcov `sed -e 's/\.exe:/.c/;s/\.o/.c/g' $(@:gcov_%=%.ld)`
        touch gcov
        rm -f gcov $(wildcard *.gcda *.gcno)
        $(MAKE) purge
+       grep '#####' *.c.gcov || true
 
 %.test: %.c
        $(call TITLE, "Building $@")
 #      awk '/\/\* *test:.*\*\// { sub(/^.*\/\* *test: */, ""); sub(/ *\*\/.*$$/, ""); print }' $< > $@
-       ./getcomments.pl -p='test:\s' -f='%' $< > $@
+       perl -- getcomments.pl -p='test:\s' -f='%' $< > $@
        $(call PASS, SUCCESS)
 
 test_%: %.test %.exe
@@ -114,24 +115,24 @@ valgrind_%: %.exe
 %.d: %.c
        $(call TITLE, "Building $@")
        $(CC) $(INCLUDES) -MM $< -o $@~
-       echo ${<:.c=.o}: $(shell ./getcomments.pl -p='depend:\s' -f='%' $<) >> $@~
+       echo ${<:.c=.o}: $(shell perl -- getcomments.pl -p='depend:\s' -f='%' $<) >> $@~
        mv $@~ $@
        $(call PASS, SUCCESS)
 
 %.ld: %.c
        $(call TITLE, "Building $@")
-       echo ${<:.c=.exe}: $(shell ./getcomments.pl -p='linker:\s' -f='%' $< | awk '{for (i=1;i<=NF;i++) if ($$(i) ~ /.o$$/) printf " %s", $$(i)}') > $@
+       echo ${<:.c=.exe}: $(shell perl -- getcomments.pl -p='linker:\s' -f='%' $< | awk '{for (i=1;i<=NF;i++) if ($$(i) ~ /.o$$/) printf " %s", $$(i)}') > $@
        $(call PASS, SUCCESS)
 
 %.o: %.c
        $(call TITLE, "Building $@")
-       $(CC) $(CFLAGS) $(INCLUDES) $(shell ./getcomments.pl -p='cflags:\s' -f='%' $<) -c $< -o $@
+       $(CC) $(CFLAGS) $(INCLUDES) $(shell perl -- getcomments.pl -p='cflags:\s' -f='%' $<) -c $< -o $@
        $(call PASS, SUCCESS)
 
 
 %.exe: %.o %.d
        $(call TITLE, "Building $@")
-       $(CC) $(LDFLAGS) $< $(shell ./getcomments.pl -p='linker:\s' -f='%' ${<:.o=.c}) -o $@
+       $(CC) $(LDFLAGS) $< $(shell perl -- getcomments.pl -p='linker:\s' -f='%' ${<:.o=.c}) -o $@
        $(call PASS, SUCCESS)
 
 ## Phony