Add targets per Makefile, allowing make -j to work

This commit is contained in:
Dave Murphy 2020-10-03 16:00:22 +01:00
parent 9db0cfd567
commit fc98393d50

View File

@ -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) DATESTRING := $(shell date +%Y)$(shell date +%m)$(shell date +%d)
all: all: $(TARGETS)
@for i in $(MAKEFILES); do $(MAKE) -C `dirname $$i` || exit 1; done;
.PHONY: $(TARGETS)
$(TARGETS):
@$(MAKE) -C $@
clean: clean:
@rm -f *.bz2 @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 dist: clean
@tar -cvjf switch-examples-$(DATESTRING).tar.bz2 * @tar -cvjf switch-examples-$(DATESTRING).tar.bz2 *