]> git.donarmstrong.com Git - qmk_firmware.git/blob - tmk_core/protocol/lufa/LUFA-git/Bootloaders/makefile
Merge commit '60b30c036397cb5627fa374bb930794b225daa29' as 'lib/lufa'
[qmk_firmware.git] / tmk_core / protocol / lufa / LUFA-git / Bootloaders / makefile
1 #
2 #             LUFA Library
3 #     Copyright (C) Dean Camera, 2014.
4 #
5 #  dean [at] fourwalledcubicle [dot] com
6 #           www.lufa-lib.org
7 #
8
9 # Makefile to build all the LUFA USB Bootloaders. Call with "make all" to
10 # rebuild all bootloaders.
11
12 # Bootloaders are pre-cleaned before each one is built, to ensure any
13 # custom LUFA library build options are reflected in the compiled
14 # code.
15
16 PROJECT_DIRECTORIES := $(shell ls -d */)
17
18 # This makefile is potentially infinitely recursive if something really bad
19 # happens when determining the set of project directories - hard-abort if
20 # more than 10 levels deep to avoid angry emails.
21 ifeq ($(MAKELEVEL), 10)
22    $(error EMERGENCY ABORT: INFINITE RECURSION DETECTED)
23 endif
24
25 # Need to special-case building without a per-project object directory
26 ifeq ($(OBJDIR),)
27    # If no target specified, force "clean all" and disallow parallel build
28    ifeq ($(MAKECMDGOALS),)
29       MAKECMDGOALS := clean all
30       .NOTPARALLEL:
31    endif
32
33    # If one of the targets is to build, force "clean" beforehand and disallow parallel build
34    ifneq ($(findstring all, $(MAKECMDGOALS)),)
35       MAKECMDGOALS := clean $(MAKECMDGOALS)
36       .NOTPARALLEL:
37    endif
38 endif
39
40 %: $(PROJECT_DIRECTORIES)
41         @echo . > /dev/null
42
43 $(PROJECT_DIRECTORIES):
44         @$(MAKE) -C $@ $(MAKECMDGOALS)
45
46 .PHONY: $(PROJECT_DIRECTORIES)