]> git.donarmstrong.com Git - qmk_firmware.git/blob - tmk_core/arm_atsam.mk
[Keyboard] leds in default keymap (#6357)
[qmk_firmware.git] / tmk_core / arm_atsam.mk
1 # Hey Emacs, this is a -*- makefile -*-
2 ##############################################################################
3 # Compiler settings
4 #
5 CC = arm-none-eabi-gcc
6 OBJCOPY = arm-none-eabi-objcopy
7 OBJDUMP = arm-none-eabi-objdump
8 SIZE = arm-none-eabi-size
9 AR = arm-none-eabi-ar
10 NM = arm-none-eabi-nm
11 HEX = $(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock -R .signature
12 EEP = $(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT)
13 BIN =
14
15 COMMON_VPATH += $(LIB_PATH)/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include
16 COMMON_VPATH += $(LIB_PATH)/arm_atsam/packs/arm/cmsis/5.0.1/CMSIS/Include
17
18 COMPILEFLAGS += -funsigned-char
19 COMPILEFLAGS += -funsigned-bitfields
20 COMPILEFLAGS += -ffunction-sections
21 COMPILEFLAGS += -fshort-enums
22 COMPILEFLAGS += -fno-inline-small-functions
23 COMPILEFLAGS += -fno-strict-aliasing
24 COMPILEFLAGS += -mfloat-abi=hard
25 COMPILEFLAGS += -mfpu=fpv4-sp-d16
26 COMPILEFLAGS += -mthumb
27
28 #ALLOW_WARNINGS = yes
29
30 CFLAGS += $(COMPILEFLAGS)
31
32 CPPFLAGS += $(COMPILEFLAGS)
33 CPPFLAGS += -fno-exceptions -std=c++11
34
35 LDFLAGS +=-Wl,--gc-sections
36 LDFLAGS += -Wl,-Map="%OUT%%PROJ_NAME%.map"
37 LDFLAGS += -Wl,--start-group
38 LDFLAGS += -Wl,--end-group
39 LDFLAGS += --specs=rdimon.specs
40 LDFLAGS += -T$(LIB_PATH)/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/gcc/gcc/samd51j18a_flash.ld
41
42 OPT_DEFS += -DPROTOCOL_ARM_ATSAM
43
44 MCUFLAGS = -mcpu=$(MCU)
45 MCUFLAGS += -D__$(ARM_ATSAM)__
46
47 # List any extra directories to look for libraries here.
48 #     Each directory must be seperated by a space.
49 #     Use forward slashes for directory separators.
50 #     For a directory that has spaces, enclose it in quotes.
51 EXTRALIBDIRS =
52
53 # Convert hex to bin.
54 bin: $(BUILD_DIR)/$(TARGET).hex
55         $(OBJCOPY) -Iihex -Obinary $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).bin
56         $(COPY) $(BUILD_DIR)/$(TARGET).bin $(TARGET).bin;