diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2015-12-22 21:22:11 +1100 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2015-12-22 21:22:11 +1100 |
commit | 09b6c80555bc17b1206ee688ccdfc76454b2dbd7 (patch) | |
tree | 95b105a5c5f9c8fcd7648dc01b50d81f994edfe6 /LUFA/Build/DMBS/DMBS/hid.mk | |
parent | b590350df0cb857bca8efdbd1be9c8532008aa54 (diff) | |
download | lufa-09b6c80555bc17b1206ee688ccdfc76454b2dbd7.tar.gz lufa-09b6c80555bc17b1206ee688ccdfc76454b2dbd7.tar.bz2 lufa-09b6c80555bc17b1206ee688ccdfc76454b2dbd7.zip |
Add DMBS; don't Submodule so that people can download complete ZIP/TAR archives.
Diffstat (limited to 'LUFA/Build/DMBS/DMBS/hid.mk')
m--------- | LUFA/Build/DMBS | 0 | ||||
-rw-r--r-- | LUFA/Build/DMBS/DMBS/hid.mk | 96 |
2 files changed, 96 insertions, 0 deletions
diff --git a/LUFA/Build/DMBS b/LUFA/Build/DMBS deleted file mode 160000 -Subproject 7dfe3cf63ab428690112b79ce5d5261945a9118 diff --git a/LUFA/Build/DMBS/DMBS/hid.mk b/LUFA/Build/DMBS/DMBS/hid.mk new file mode 100644 index 000000000..3f0d456e1 --- /dev/null +++ b/LUFA/Build/DMBS/DMBS/hid.mk @@ -0,0 +1,96 @@ +# +# DMBS Build System +# Released into the public domain. +# +# dean [at] fourwalledcubicle [dot] com +# www.fourwalledcubicle.com +# + +DMBS_BUILD_MODULES += HID +DMBS_BUILD_TARGETS += hid hid-ee teensy teensy-ee +DMBS_BUILD_MANDATORY_VARS += MCU TARGET +DMBS_BUILD_OPTIONAL_VARS += +DMBS_BUILD_PROVIDED_VARS += +DMBS_BUILD_PROVIDED_MACROS += + +# ----------------------------------------------------------------------------- +# DMBS HID Bootloader Buildsystem Makefile Module. +# ----------------------------------------------------------------------------- +# DESCRIPTION: +# Provides a set of targets to re-program a device currently running a HID +# class bootloader with a project's FLASH files. +# ----------------------------------------------------------------------------- +# TARGETS: +# +# hid - Program FLASH into target via +# hid_bootloader_cli +# hid-ee - Program EEPROM into target via a temporary +# AVR application and hid_bootloader_cli +# teensy - Program FLASH into target via +# teensy_loader_cli +# teensy-ee - Program EEPROM into target via a temporary +# AVR application and teensy_loader_cli +# +# MANDATORY PARAMETERS: +# +# MCU - Microcontroller device model name +# TARGET - Application name +# +# OPTIONAL PARAMETERS: +# +# (None) +# +# PROVIDED VARIABLES: +# +# (None) +# +# PROVIDED MACROS: +# +# (None) +# +# ----------------------------------------------------------------------------- + +SHELL = /bin/sh + +DMBS_MODULE_PATH := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST)))) + +ERROR_IF_UNSET ?= $(if $(filter undefined, $(origin $(strip $(1)))), $(error Makefile $(strip $(1)) value not set)) +ERROR_IF_EMPTY ?= $(if $(strip $($(strip $(1)))), , $(error Makefile $(strip $(1)) option cannot be blank)) +ERROR_IF_NONBOOL ?= $(if $(filter Y N, $($(strip $(1)))), , $(error Makefile $(strip $(1)) option must be Y or N)) + +# Sanity-check values of mandatory user-supplied variables +$(foreach MANDATORY_VAR, $(DMBS_BUILD_MANDATORY_VARS), $(call ERROR_IF_UNSET, $(MANDATORY_VAR))) +$(call ERROR_IF_EMPTY, MCU) +$(call ERROR_IF_EMPTY, TARGET) + +# Output Messages +MSG_HID_BOOTLOADER_CMD := ' [HID] :' +MSG_OBJCPY_CMD := ' [OBJCPY] :' +MSG_MAKE_CMD := ' [MAKE] :' + +# Programs in the target FLASH memory using the HID_BOOTLOADER_CLI tool +hid: $(TARGET).hex $(MAKEFILE_LIST) + @echo $(MSG_HID_BOOTLOADER_CMD) Programming FLASH with hid_bootloader_cli using \"$<\" + hid_bootloader_cli -mmcu=$(MCU) -v $< + +# Programs in the target EEPROM memory using the HID_BOOTLOADER_CLI tool (note: clears target FLASH memory) +hid-ee: $(TARGET).eep $(MAKEFILE_LIST) + @echo $(MSG_OBJCPY_CMD) Converting \"$<\" to a binary file \"InputEEData.bin\" + avr-objcopy -I ihex -O binary $< $(DMBS_MODULE_PATH)/HID_EEPROM_Loader/InputEEData.bin + @echo $(MSG_MAKE_CMD) Making EEPROM loader application for \"$<\" + $(MAKE) -C $(DMBS_MODULE_PATH)/HID_EEPROM_Loader/ MCU=$(MCU) clean hid + +# Programs in the target FLASH memory using the TEENSY_BOOTLOADER_CLI tool +teensy: $(TARGET).hex $(MAKEFILE_LIST) + @echo $(MSG_HID_BOOTLOADER_CMD) Programming FLASH with teensy_loader_cli using \"$<\" + teensy_loader_cli -mmcu=$(MCU) -v $< + +# Programs in the target EEPROM memory using the TEENSY_BOOTLOADER_CLI tool (note: clears target FLASH memory) +teensy-ee: $(TARGET).hex $(MAKEFILE_LIST) + @echo $(MSG_OBJCPY_CMD) Converting \"$<\" to a binary file \"InputEEData.bin\" + avr-objcopy -I ihex -O binary $< $(DMBS_MODULE_PATH)/HID_EEPROM_Loader/InputEEData.bin + @echo $(MSG_MAKE_CMD) Making EEPROM loader application for \"$<\" + $(MAKE) -s -C $(DMBS_MODULE_PATH)/HID_EEPROM_Loader/ MCU=$(MCU) clean teensy + +# Phony build targets for this module +.PHONY: $(DMBS_BUILD_TARGETS) |