aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Device/ClassDriver/makefile
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2012-07-10 18:30:41 +0000
committerDean Camera <dean@fourwalledcubicle.com>2012-07-10 18:30:41 +0000
commit7f29c468d7bfce620f49ba1c0898bc68e95597f3 (patch)
treeefc5238c97e02270f002f474c64503a9571af98d /Demos/Device/ClassDriver/makefile
parentfafb52118d048f54675529b3d68f0cee706271d8 (diff)
downloadlufa-7f29c468d7bfce620f49ba1c0898bc68e95597f3.tar.gz
lufa-7f29c468d7bfce620f49ba1c0898bc68e95597f3.tar.bz2
lufa-7f29c468d7bfce620f49ba1c0898bc68e95597f3.zip
Slightly better method of recursive make - use proper make dependencies to allow for parallel builds.
Diffstat (limited to 'Demos/Device/ClassDriver/makefile')
-rw-r--r--Demos/Device/ClassDriver/makefile21
1 files changed, 17 insertions, 4 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)