remove duplicated code
[calc.git] / makefile
index 40cfde7c33adb4477999621f99273f4e539a26f2..674c73f9dd9180499a8f71c068e247a5bd672437 100644 (file)
--- a/makefile
+++ b/makefile
@@ -18,11 +18,11 @@ LDFLAGS += -g
 
 ALLEXE  =
 ALLEXE += calc
-ALLEXE += skel
+#ALLEXE += skel
 
 SHELL = bash
 
-MAKE = mingw32-make
+#MAKE = mingw32-make
 MAKEFLAGS += -s
 
 # Functions
@@ -43,9 +43,6 @@ VALID = $(call TITLE, $(1)) && $(2) && $(call PASS, SUCCESS) || { $(call FAIL, F
 all: depends
        $(MAKE) $(ALLEXE:%=%.exe)
 
-alltests: all
-       $(MAKE) $(addprefix test_,$(ALLEXE:%.exe=%))
-
 depends: $(patsubst %.c, %.d, $(wildcard *.c)) $(patsubst %, %.ld, $(ALLEXE))
 
 count:
@@ -63,6 +60,9 @@ purge: clean
        rm -f purge $(ALLEXE) $(shell [ -f .targets ] && { cat .targets | sort | uniq; echo .targets; })
        $(call PASS, SUCCESS)
 
+tests: all
+       $(MAKE) $(addprefix test_,$(ALLEXE:%.exe=%))
+
 ## Main rules
 
 include $(wildcard *.d)
@@ -98,7 +98,7 @@ valgrind_%: %
 
 %.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 ./getcomments.pl -p='linker:\s' -f='%' $< | awk '{for (i=1;i<=NF;i++) if ($$(i) ~ /.o$$/) printf " %s", $$(i)}') > $@
        $(call PASS, SUCCESS)
 
 %.o: %.c