diff options
Diffstat (limited to 'Demos/Device')
-rw-r--r-- | Demos/Device/ClassDriver/makefile | 21 | ||||
-rw-r--r-- | Demos/Device/LowLevel/makefile | 21 |
2 files changed, 34 insertions, 8 deletions
diff --git a/Demos/Device/ClassDriver/makefile b/Demos/Device/ClassDriver/makefile index ad8800091..3a5615e05 100644 --- a/Demos/Device/ClassDriver/makefile +++ b/Demos/Device/ClassDriver/makefile @@ -22,10 +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) diff --git a/Demos/Device/LowLevel/makefile b/Demos/Device/LowLevel/makefile index ad8800091..3a5615e05 100644 --- a/Demos/Device/LowLevel/makefile +++ b/Demos/Device/LowLevel/makefile @@ -22,10 +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) |