Move out BUILD build system module start and end messages to the respective targets...
[pub/USBasp.git] / LUFA / Build / lufa.hid.in
1 #
2 # LUFA Library
3 # Copyright (C) Dean Camera, 2012.
4 #
5 # dean [at] fourwalledcubicle [dot] com
6 # www.lufa-lib.org
7 #
8
9 LUFA_BUILD_MODULES += HID
10 LUFA_BUILD_TARGETS += hid hid-teensy
11 LUFA_BUILD_MANDATORY_VARS += MCU TARGET
12 LUFA_BUILD_OPTIONAL_VARS +=
13 LUFA_BUILD_PROVIDED_VARS +=
14 LUFA_BUILD_PROVIDED_MACROS +=
15
16 # -----------------------------------------------------------------------------
17 # LUFA HID Bootloader Buildsystem Makefile Module.
18 # -----------------------------------------------------------------------------
19 # DESCRIPTION:
20 # Provides a set of targets to re-program a device currently running a HID
21 # class bootloader with a project's FLASH files.
22 # -----------------------------------------------------------------------------
23 # TARGETS:
24 #
25 # hid - Program FLASH into target via
26 # hid_bootloader_cli
27 # hid-teensy - Program FLASH into target via
28 # teensy_loader_cli
29 #
30 # MANDATORY PARAMETERS:
31 #
32 # MCU - Microcontroller device model name
33 # TARGET - Application name
34 #
35 # OPTIONAL PARAMETERS:
36 #
37 # (None)
38 #
39 # PROVIDED VARIABLES:
40 #
41 # (None)
42 #
43 # PROVIDED MACROS:
44 #
45 # (None)
46 #
47 # -----------------------------------------------------------------------------
48
49 ERROR_IF_UNSET ?= $(if $(filter undefined, $(origin $(strip $(1)))), $(error Makefile $(strip $(1)) value not set))
50 ERROR_IF_EMPTY ?= $(if $(strip $($(strip $(1)))), , $(error Makefile $(strip $(1)) option cannot be blank))
51 ERROR_IF_NONBOOL ?= $(if $(filter Y N, $($(strip $(1)))), , $(error Makefile $(strip $(1)) option must be Y or N))
52
53 # Sanity-check values of mandatory user-supplied variables
54 $(foreach MANDATORY_VAR, $(LUFA_BUILD_MANDATORY_VARS), $(call ERROR_IF_UNSET, $(MANDATORY_VAR)))
55 $(call ERROR_IF_EMPTY, MCU)
56 $(call ERROR_IF_EMPTY, TARGET)
57
58 # Output Messages
59 MSG_HID_BOOTLOADER_CMD := ' [HID] :'
60
61 hid: $(TARGET).hex $(MAKEFILE_LIST)
62 @echo $(MSG_HID_BOOTLOADER_CMD) Programming FLASH with hid_bootloader_cli using \"$<\"
63 hid_bootloader_cli -mmcu=$(MCU) -v $<
64
65 hid-teensy: $(TARGET).hex $(MAKEFILE_LIST)
66 @echo $(MSG_HID_BOOTLOADER_CMD) Programming FLASH with teensy_loader_cli using \"$<\"
67 teensy_loader_cli -mmcu=$(MCU) -v $<
68
69 # Phony build targets for this module
70 .PHONY: hid hid-teensy