From fc98393d50e7896fcc8d59295516c2d1640f043f Mon Sep 17 00:00:00 2001 From: Dave Murphy Date: Sat, 3 Oct 2020 16:00:22 +0100 Subject: [PATCH] Add targets per Makefile, allowing make -j to work --- Makefile | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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 *