diff --git a/Makefile b/Makefile index ad29a37..b7577c1 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,19 @@ -MAKEFILES := $(shell find . -mindepth 2 -name Makefile) +MAKEFILES := $(subst ./,,$(shell find . -mindepth 2 -name Makefile)) + +TARGETS := $(dir $(MAKEFILES)) DATESTRING := $(shell date +%Y)$(shell date +%m)$(shell date +%d) -all: - @for i in $(MAKEFILES); do $(MAKE) -C `dirname $$i` || exit 1; done; +all: $(TARGETS) + +.PHONY: $(TARGETS) + +$(TARGETS): + @$(MAKE) -C $@ clean: @rm -f *.bz2 - @for i in $(MAKEFILES); do $(MAKE) -C `dirname $$i` clean || exit 1; done; + @for i in $(TARGETS); do $(MAKE) -C $$i clean || exit 1; done; dist: clean @tar -cvjf switch-examples-$(DATESTRING).tar.bz2 *