diff options
Diffstat (limited to 'Demos/DualRole')
| -rw-r--r-- | Demos/DualRole/ClassDriver/MouseHostDevice/makefile | 17 | ||||
| -rw-r--r-- | Demos/DualRole/ClassDriver/makefile | 33 | ||||
| -rw-r--r-- | Demos/DualRole/makefile | 2 |
3 files changed, 40 insertions, 12 deletions
diff --git a/Demos/DualRole/ClassDriver/MouseHostDevice/makefile b/Demos/DualRole/ClassDriver/MouseHostDevice/makefile index a04f5336..f979d02c 100644 --- a/Demos/DualRole/ClassDriver/MouseHostDevice/makefile +++ b/Demos/DualRole/ClassDriver/MouseHostDevice/makefile @@ -17,7 +17,7 @@ F_USB = $(F_CPU) OPTIMIZATION = s TARGET = MouseHostDevice SRC = $(TARGET).c Descriptors.c DeviceFunctions.c HostFunctions.c $(LUFA_SRC_USB) $(LUFA_SRC_USBCLASS) $(LUFA_SRC_SERIAL) -LUFA_PATH = ../../../../LUFA/ +LUFA_PATH = ../../../../LUFA CC_FLAGS = -DUSE_LUFA_CONFIG_HEADER -IConfig/ LD_FLAGS = @@ -25,9 +25,12 @@ LD_FLAGS = all: # Include LUFA build script makefiles -include $(LUFA_PATH)/Build/lufa.core.in -include $(LUFA_PATH)/Build/lufa.sources.in -include $(LUFA_PATH)/Build/lufa.build.in -include $(LUFA_PATH)/Build/lufa.doxygen.in -include $(LUFA_PATH)/Build/lufa.dfu.in -include $(LUFA_PATH)/Build/lufa.avrdude.in +include $(LUFA_PATH)/Build/lufa_core.mk +include $(LUFA_PATH)/Build/lufa_sources.mk +include $(LUFA_PATH)/Build/lufa_build.mk +include $(LUFA_PATH)/Build/lufa_cppcheck.mk +include $(LUFA_PATH)/Build/lufa_doxygen.mk +include $(LUFA_PATH)/Build/lufa_dfu.mk +include $(LUFA_PATH)/Build/lufa_hid.mk +include $(LUFA_PATH)/Build/lufa_avrdude.mk +include $(LUFA_PATH)/Build/lufa_atprogram.mk diff --git a/Demos/DualRole/ClassDriver/makefile b/Demos/DualRole/ClassDriver/makefile index 28e06a3c..6d16493e 100644 --- a/Demos/DualRole/ClassDriver/makefile +++ b/Demos/DualRole/ClassDriver/makefile @@ -13,9 +13,34 @@ # custom LUFA library build options are reflected in the compiled # code. -all: - $(MAKE) -s -C MouseHostDevice clean all +PROJECT_DIRECTORIES := $(shell ls -d */) -%: - $(MAKE) -s -C MouseHostDevice $@ +# This makefile is potentially infinitely recursive if something really bad +# happens when determining the set of project directories - hard-abort if +# more than 10 levels deep to avoid angry emails. +ifeq ($(MAKELEVEL), 10) + $(error EMERGENCY ABORT: INFINITE RECURSION DETECTED) +endif +# Need to special-case building without a per-project object directory +ifeq ($(OBJDIR),) + # If no target specified, force "clean all" and disallow parallel build + ifeq ($(MAKECMDGOALS),) + MAKECMDGOALS := clean all + .NOTPARALLEL: + endif + + # If one of the targets is to build, force "clean" beforehand and disallow parallel build + ifneq ($(findstring all, $(MAKECMDGOALS)),) + MAKECMDGOALS := clean $(MAKECMDGOALS) + .NOTPARALLEL: + endif +endif + +%: $(PROJECT_DIRECTORIES) + @echo . > /dev/null + +$(PROJECT_DIRECTORIES): + @$(MAKE) -C $@ $(MAKECMDGOALS) + +.PHONY: $(PROJECT_DIRECTORIES) diff --git a/Demos/DualRole/makefile b/Demos/DualRole/makefile index dbfe9995..aaca6257 100644 --- a/Demos/DualRole/makefile +++ b/Demos/DualRole/makefile @@ -16,5 +16,5 @@ all: %: - $(MAKE) -C ClassDriver/ $@ + $(MAKE) -C ClassDriver $@ |
