diff options
Diffstat (limited to 'Demos/DualRole/ClassDriver/makefile')
-rw-r--r-- | Demos/DualRole/ClassDriver/makefile | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/Demos/DualRole/ClassDriver/makefile b/Demos/DualRole/ClassDriver/makefile index 741383f18..71fb805ef 100644 --- a/Demos/DualRole/ClassDriver/makefile +++ b/Demos/DualRole/ClassDriver/makefile @@ -22,11 +22,23 @@ ifeq ($(MAKELEVEL), 10) $(error EMERGENCY ABORT: INFINITE RECURSION DETECTED) endif -all: +# If building without a per-project object directory, we can't build in parallel ifeq ($(OBJDIR),) - @$(foreach PROJECT, $(PROJECT_DIRECTORIES), $(MAKE) -C $(PROJECT) clean all;) + .NOTPARALLEL: + + # Ensure projects are pre-cleaned if the target is the default or "all" + ifeq ($(MAKECMDGOALS),) + MAKECMDGOALS := clean all + endif + ifneq ($(findstring all, $(MAKECMDGOALS)),) + MAKECMDGOALS := clean $(MAKECMDGOALS) + endif endif -%: - @$(foreach PROJECT, $(PROJECT_DIRECTORIES), $(MAKE) -C $(PROJECT) $@;) +%: $(PROJECT_DIRECTORIES) + @echo . > /dev/null +$(PROJECT_DIRECTORIES): + @$(MAKE) -C $@ $(MAKECMDGOALS) + +.PHONY: $(PROJECT_DIRECTORIES) |