aboutsummaryrefslogtreecommitdiff
path: root/lib/lufa/Bootloaders/MassStorage/makefile
diff options
context:
space:
mode:
Diffstat (limited to 'lib/lufa/Bootloaders/MassStorage/makefile')
-rw-r--r--lib/lufa/Bootloaders/MassStorage/makefile150
1 files changed, 75 insertions, 75 deletions
diff --git a/lib/lufa/Bootloaders/MassStorage/makefile b/lib/lufa/Bootloaders/MassStorage/makefile
index 7f0ec82a7..f3948e754 100644
--- a/lib/lufa/Bootloaders/MassStorage/makefile
+++ b/lib/lufa/Bootloaders/MassStorage/makefile
@@ -1,75 +1,75 @@
1# 1#
2# LUFA Library 2# LUFA Library
3# Copyright (C) Dean Camera, 2017. 3# Copyright (C) Dean Camera, 2017.
4# 4#
5# dean [at] fourwalledcubicle [dot] com 5# dean [at] fourwalledcubicle [dot] com
6# www.lufa-lib.org 6# www.lufa-lib.org
7# 7#
8# -------------------------------------- 8# --------------------------------------
9# LUFA Project Makefile. 9# LUFA Project Makefile.
10# -------------------------------------- 10# --------------------------------------
11 11
12# Run "make help" for target help. 12# Run "make help" for target help.
13 13
14MCU = at90usb1287 14MCU = at90usb1287
15ARCH = AVR8 15ARCH = AVR8
16BOARD = USBKEY 16BOARD = USBKEY
17F_CPU = 8000000 17F_CPU = 8000000
18F_USB = $(F_CPU) 18F_USB = $(F_CPU)
19OPTIMIZATION = s 19OPTIMIZATION = s
20TARGET = BootloaderMassStorage 20TARGET = BootloaderMassStorage
21SRC = $(TARGET).c Descriptors.c BootloaderAPI.c BootloaderAPITable.S Lib/SCSI.c Lib/VirtualFAT.c $(LUFA_SRC_USB) $(LUFA_SRC_USBCLASS) 21SRC = $(TARGET).c Descriptors.c BootloaderAPI.c BootloaderAPITable.S Lib/SCSI.c Lib/VirtualFAT.c $(LUFA_SRC_USB) $(LUFA_SRC_USBCLASS)
22LUFA_PATH = ../../LUFA 22LUFA_PATH = ../../LUFA
23CC_FLAGS = -DUSE_LUFA_CONFIG_HEADER -IConfig/ -DBOOT_START_ADDR=$(BOOT_START_OFFSET) 23CC_FLAGS = -DUSE_LUFA_CONFIG_HEADER -IConfig/ -DBOOT_START_ADDR=$(BOOT_START_OFFSET)
24LD_FLAGS = -Wl,--section-start=.text=$(BOOT_START_OFFSET) $(BOOT_API_LD_FLAGS) 24LD_FLAGS = -Wl,--section-start=.text=$(BOOT_START_OFFSET) $(BOOT_API_LD_FLAGS)
25 25
26# Flash size and bootloader section sizes of the target, in KB. These must 26# Flash size and bootloader section sizes of the target, in KB. These must
27# match the target's total FLASH size and the bootloader size set in the 27# match the target's total FLASH size and the bootloader size set in the
28# device's fuses. 28# device's fuses.
29FLASH_SIZE_KB = 128 29FLASH_SIZE_KB = 128
30BOOT_SECTION_SIZE_KB = 8 30BOOT_SECTION_SIZE_KB = 8
31 31
32# Bootloader address calculation formulas 32# Bootloader address calculation formulas
33# Do not modify these macros, but rather modify the dependent values above. 33# Do not modify these macros, but rather modify the dependent values above.
34CALC_ADDRESS_IN_HEX = $(shell printf "0x%X" $$(( $(1) )) ) 34CALC_ADDRESS_IN_HEX = $(shell printf "0x%X" $$(( $(1) )) )
35BOOT_START_OFFSET = $(call CALC_ADDRESS_IN_HEX, ($(FLASH_SIZE_KB) - $(BOOT_SECTION_SIZE_KB)) * 1024 ) 35BOOT_START_OFFSET = $(call CALC_ADDRESS_IN_HEX, ($(FLASH_SIZE_KB) - $(BOOT_SECTION_SIZE_KB)) * 1024 )
36BOOT_SEC_OFFSET = $(call CALC_ADDRESS_IN_HEX, ($(FLASH_SIZE_KB) * 1024) - ($(strip $(1))) ) 36BOOT_SEC_OFFSET = $(call CALC_ADDRESS_IN_HEX, ($(FLASH_SIZE_KB) * 1024) - ($(strip $(1))) )
37 37
38# Bootloader linker section flags for relocating the API table sections to 38# Bootloader linker section flags for relocating the API table sections to
39# known FLASH addresses - these should not normally be user-edited. 39# known FLASH addresses - these should not normally be user-edited.
40BOOT_SECTION_LD_FLAG = -Wl,--section-start=$(strip $(1))=$(call BOOT_SEC_OFFSET, $(3)) -Wl,--undefined=$(strip $(2)) 40BOOT_SECTION_LD_FLAG = -Wl,--section-start=$(strip $(1))=$(call BOOT_SEC_OFFSET, $(3)) -Wl,--undefined=$(strip $(2))
41BOOT_API_LD_FLAGS = $(call BOOT_SECTION_LD_FLAG, .apitable_trampolines, BootloaderAPI_Trampolines, 96) 41BOOT_API_LD_FLAGS = $(call BOOT_SECTION_LD_FLAG, .apitable_trampolines, BootloaderAPI_Trampolines, 96)
42BOOT_API_LD_FLAGS += $(call BOOT_SECTION_LD_FLAG, .apitable_jumptable, BootloaderAPI_JumpTable, 32) 42BOOT_API_LD_FLAGS += $(call BOOT_SECTION_LD_FLAG, .apitable_jumptable, BootloaderAPI_JumpTable, 32)
43BOOT_API_LD_FLAGS += $(call BOOT_SECTION_LD_FLAG, .apitable_signatures, BootloaderAPI_Signatures, 8) 43BOOT_API_LD_FLAGS += $(call BOOT_SECTION_LD_FLAG, .apitable_signatures, BootloaderAPI_Signatures, 8)
44 44
45# Check if the bootloader needs an AUX section, located before the real bootloader section to store some of the 45# Check if the bootloader needs an AUX section, located before the real bootloader section to store some of the
46# bootloader code. This is required for 32KB and smaller devices, where the actual bootloader is 6KB but the maximum 46# bootloader code. This is required for 32KB and smaller devices, where the actual bootloader is 6KB but the maximum
47# bootloader section size is 4KB. The actual usable application space will be reduced by 6KB for these devices. 47# bootloader section size is 4KB. The actual usable application space will be reduced by 6KB for these devices.
48ifeq ($(BOOT_SECTION_SIZE_KB),8) 48ifeq ($(BOOT_SECTION_SIZE_KB),8)
49 CC_FLAGS += -DAUX_BOOT_SECTION_SIZE=0 49 CC_FLAGS += -DAUX_BOOT_SECTION_SIZE=0
50else 50else
51 AUX_BOOT_SECTION_SIZE_KB = (6 - $(BOOT_SECTION_SIZE_KB)) 51 AUX_BOOT_SECTION_SIZE_KB = (6 - $(BOOT_SECTION_SIZE_KB))
52 52
53 CC_FLAGS += -DAUX_BOOT_SECTION_SIZE='($(AUX_BOOT_SECTION_SIZE_KB) * 1024)' 53 CC_FLAGS += -DAUX_BOOT_SECTION_SIZE='($(AUX_BOOT_SECTION_SIZE_KB) * 1024)'
54 LD_FLAGS += -Wl,--section-start=.boot_aux=$(call BOOT_SEC_OFFSET, (($(BOOT_SECTION_SIZE_KB) + $(AUX_BOOT_SECTION_SIZE_KB)) * 1024 - 16)) 54 LD_FLAGS += -Wl,--section-start=.boot_aux=$(call BOOT_SEC_OFFSET, (($(BOOT_SECTION_SIZE_KB) + $(AUX_BOOT_SECTION_SIZE_KB)) * 1024 - 16))
55 LD_FLAGS += $(call BOOT_SECTION_LD_FLAG, .boot_aux_trampoline, Boot_AUX_Trampoline, ($(BOOT_SECTION_SIZE_KB) + $(AUX_BOOT_SECTION_SIZE_KB)) * 1024) 55 LD_FLAGS += $(call BOOT_SECTION_LD_FLAG, .boot_aux_trampoline, Boot_AUX_Trampoline, ($(BOOT_SECTION_SIZE_KB) + $(AUX_BOOT_SECTION_SIZE_KB)) * 1024)
56endif 56endif
57 57
58# Default target 58# Default target
59all: 59all:
60 60
61# Include LUFA-specific DMBS extension modules 61# Include LUFA-specific DMBS extension modules
62DMBS_LUFA_PATH ?= $(LUFA_PATH)/Build/LUFA 62DMBS_LUFA_PATH ?= $(LUFA_PATH)/Build/LUFA
63include $(DMBS_LUFA_PATH)/lufa-sources.mk 63include $(DMBS_LUFA_PATH)/lufa-sources.mk
64include $(DMBS_LUFA_PATH)/lufa-gcc.mk 64include $(DMBS_LUFA_PATH)/lufa-gcc.mk
65 65
66# Include common DMBS build system modules 66# Include common DMBS build system modules
67DMBS_PATH ?= $(LUFA_PATH)/Build/DMBS/DMBS 67DMBS_PATH ?= $(LUFA_PATH)/Build/DMBS/DMBS
68include $(DMBS_PATH)/core.mk 68include $(DMBS_PATH)/core.mk
69include $(DMBS_PATH)/cppcheck.mk 69include $(DMBS_PATH)/cppcheck.mk
70include $(DMBS_PATH)/doxygen.mk 70include $(DMBS_PATH)/doxygen.mk
71include $(DMBS_PATH)/dfu.mk 71include $(DMBS_PATH)/dfu.mk
72include $(DMBS_PATH)/gcc.mk 72include $(DMBS_PATH)/gcc.mk
73include $(DMBS_PATH)/hid.mk 73include $(DMBS_PATH)/hid.mk
74include $(DMBS_PATH)/avrdude.mk 74include $(DMBS_PATH)/avrdude.mk
75include $(DMBS_PATH)/atprogram.mk 75include $(DMBS_PATH)/atprogram.mk