Add targets per Makefile, allowing make -j to work

This commit is contained in:
Vicki Pfau 2020-10-01 01:47:19 -07:00
parent 9db0cfd567
commit 8fcbec6648

View File

@ -1,13 +1,17 @@
MAKEFILES := $(shell find . -mindepth 2 -name Makefile)
TARGETS := $(subst ./,,$(shell find . -mindepth 2 -name Makefile -printf "%h "))
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 *