fix percent printing
[calc.git] / makefile
index 0f6cb9b1b02be3b3ee03908b2c414822757badce..f5e19b9bf3cf3464218cfbfba33ae02eb6d2366c 100644 (file)
--- a/makefile
+++ b/makefile
@@ -60,7 +60,16 @@ gcovs:
 purge: clean
        $(call TITLE, "Purging")
        touch purge
-       rm -f purge $(ALLEXE:%=%.exe) $(shell [ -f .targets ] && { cat .targets | sort | uniq; echo .targets; })
+       rm -f purge $(ALLEXE:%=%.exe)
+       $(call PASS, SUCCESS)
+
+valgrinds:
+       $(MAKE) $(addprefix valgrind_,$(ALLEXE))
+
+wipe: purge
+       $(call TITLE, "Wiping")
+       touch wipe
+       rm -f wipe $(wildcard *.gcda *.gcno)
        $(call PASS, SUCCESS)
 
 tests: all
@@ -72,13 +81,13 @@ include $(wildcard *.d)
 include $(wildcard *.ld)
 
 gcov_%:
-       make purge
-       CFLAGS="-fprofile-arcs -ftest-coverage" LDFLAGS="-fprofile-arcs -ftest-coverage" make
-       make test_$(@:gcov_%=%)
+       $(MAKE) purge
+       CFLAGS="-fprofile-arcs -ftest-coverage" LDFLAGS="-fprofile-arcs -ftest-coverage" $(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
+       $(MAKE) purge
 
 %.test: %.c
        $(call TITLE, "Building $@")
@@ -96,10 +105,10 @@ test_%: %.test %.exe
        done; \
        test "$$RC" -ne 1 
 
-valgrind_%: %
+valgrind_%: %.exe
        VALGRIND="valgrind -v --leak-check=full --show-reachable=yes --log-fd=2"; \
        export VALGRIND; \
-       $(MAKE) test_$<
+       $(MAKE) $(@:valgrind_%=test_%)
 
 %.d: %.c
        $(call TITLE, "Building $@")