From 8fcbec6648d68a884758fcd3a41d5599d3e7f864 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Thu, 1 Oct 2020 01:47:19 -0700 Subject: [PATCH] Add targets per Makefile, allowing make -j to work --- Makefile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index ad29a37..bd15206 100644 --- a/Makefile +++ b/Makefile @@ -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 *