summaryrefslogtreecommitdiffstats
path: root/lib/lufa/Bootloaders/CDC/makefile
diff options
context:
space:
mode:
authorJack Humbert <jack.humb@gmail.com>2017-07-07 21:33:29 +0200
committerGitHub <noreply@github.com>2017-07-07 21:33:29 +0200
commit9de443cbf10ac41bc15762c9c83f138f51dd3b9a (patch)
treed8ddcb428e0b7d9773a1e52c42b60bdca2658beb /lib/lufa/Bootloaders/CDC/makefile
parent88b3d051b21cb1ddacc6353c5d59b19f03f3a242 (diff)
parent1c26468ad5a0701e244c99cbcbc547c93b75d515 (diff)
downloadqmk_firmware-9de443cbf10ac41bc15762c9c83f138f51dd3b9a.tar.gz
qmk_firmware-9de443cbf10ac41bc15762c9c83f138f51dd3b9a.tar.xz
Merge pull request #1471 from qmk/lufa_lib
Update LUFA and move it to /lib/lufa
Diffstat (limited to 'lib/lufa/Bootloaders/CDC/makefile')
-rw-r--r--lib/lufa/Bootloaders/CDC/makefile62
1 files changed, 62 insertions, 0 deletions
diff --git a/lib/lufa/Bootloaders/CDC/makefile b/lib/lufa/Bootloaders/CDC/makefile
new file mode 100644
index 000000000..aa5a2117d
--- /dev/null
+++ b/lib/lufa/Bootloaders/CDC/makefile
@@ -0,0 +1,62 @@
+#
+# LUFA Library
+# Copyright (C) Dean Camera, 2017.
+#
+# dean [at] fourwalledcubicle [dot] com
+# www.lufa-lib.org
+#
+# --------------------------------------
+# LUFA Project Makefile.
+# --------------------------------------
+
+# Run "make help" for target help.
+
+MCU = at90usb1287
+ARCH = AVR8
+BOARD = USBKEY
+F_CPU = 8000000
+F_USB = $(F_CPU)
+OPTIMIZATION = s
+TARGET = BootloaderCDC
+SRC = $(TARGET).c Descriptors.c BootloaderAPI.c BootloaderAPITable.S $(LUFA_SRC_USB)
+LUFA_PATH = ../../LUFA
+CC_FLAGS = -DUSE_LUFA_CONFIG_HEADER -IConfig/ -DBOOT_START_ADDR=$(BOOT_START_OFFSET)
+LD_FLAGS = -Wl,--section-start=.text=$(BOOT_START_OFFSET) $(BOOT_API_LD_FLAGS)
+
+# Flash size and bootloader section sizes of the target, in KB. These must
+# match the target's total FLASH size and the bootloader size set in the
+# device's fuses.
+FLASH_SIZE_KB = 128
+BOOT_SECTION_SIZE_KB = 8
+
+# Bootloader address calculation formulas
+# Do not modify these macros, but rather modify the dependent values above.
+CALC_ADDRESS_IN_HEX = $(shell printf "0x%X" $$(( $(1) )) )
+BOOT_START_OFFSET = $(call CALC_ADDRESS_IN_HEX, ($(FLASH_SIZE_KB) - $(BOOT_SECTION_SIZE_KB)) * 1024 )
+BOOT_SEC_OFFSET = $(call CALC_ADDRESS_IN_HEX, ($(FLASH_SIZE_KB) * 1024) - ($(strip $(1))) )
+
+# Bootloader linker section flags for relocating the API table sections to
+# known FLASH addresses - these should not normally be user-edited.
+BOOT_SECTION_LD_FLAG = -Wl,--section-start=$(strip $(1))=$(call BOOT_SEC_OFFSET, $(3)) -Wl,--undefined=$(strip $(2))
+BOOT_API_LD_FLAGS = $(call BOOT_SECTION_LD_FLAG, .apitable_trampolines, BootloaderAPI_Trampolines, 96)
+BOOT_API_LD_FLAGS += $(call BOOT_SECTION_LD_FLAG, .apitable_jumptable, BootloaderAPI_JumpTable, 32)
+BOOT_API_LD_FLAGS += $(call BOOT_SECTION_LD_FLAG, .apitable_signatures, BootloaderAPI_Signatures, 8)
+
+# Default target
+all:
+
+# Include LUFA-specific DMBS extension modules
+DMBS_LUFA_PATH ?= $(LUFA_PATH)/Build/LUFA
+include $(DMBS_LUFA_PATH)/lufa-sources.mk
+include $(DMBS_LUFA_PATH)/lufa-gcc.mk
+
+# Include common DMBS build system modules
+DMBS_PATH ?= $(LUFA_PATH)/Build/DMBS/DMBS
+include $(DMBS_PATH)/core.mk
+include $(DMBS_PATH)/cppcheck.mk
+include $(DMBS_PATH)/doxygen.mk
+include $(DMBS_PATH)/dfu.mk
+include $(DMBS_PATH)/gcc.mk
+include $(DMBS_PATH)/hid.mk
+include $(DMBS_PATH)/avrdude.mk
+include $(DMBS_PATH)/atprogram.mk