arm_atsam.mk 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. COMMON_VPATH += $(LIB_PATH)/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include
  15. COMMON_VPATH += $(LIB_PATH)/arm_atsam/packs/arm/cmsis/5.0.1/CMSIS/Include
  16. COMPILEFLAGS += -funsigned-char
  17. COMPILEFLAGS += -funsigned-bitfields
  18. COMPILEFLAGS += -ffunction-sections
  19. COMPILEFLAGS += -fshort-enums
  20. COMPILEFLAGS += -fno-inline-small-functions
  21. COMPILEFLAGS += -fno-strict-aliasing
  22. COMPILEFLAGS += -mfloat-abi=hard
  23. COMPILEFLAGS += -mfpu=fpv4-sp-d16
  24. COMPILEFLAGS += -mthumb
  25. #ALLOW_WARNINGS = yes
  26. CFLAGS += $(COMPILEFLAGS)
  27. CXXFLAGS += $(COMPILEFLAGS)
  28. CXXFLAGS += -fno-exceptions -std=c++11
  29. LDFLAGS +=-Wl,--gc-sections
  30. LDFLAGS += -Wl,-Map="%OUT%%PROJ_NAME%.map"
  31. LDFLAGS += -Wl,--start-group
  32. LDFLAGS += -Wl,--end-group
  33. LDFLAGS += --specs=rdimon.specs
  34. LDFLAGS += -T$(LIB_PATH)/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/gcc/gcc/samd51j18a_flash.ld
  35. OPT_DEFS += -DPROTOCOL_ARM_ATSAM
  36. MCUFLAGS = -mcpu=$(MCU)
  37. MCUFLAGS += -D__$(ARM_ATSAM)__
  38. # List any extra directories to look for libraries here.
  39. # Each directory must be seperated by a space.
  40. # Use forward slashes for directory separators.
  41. # For a directory that has spaces, enclose it in quotes.
  42. EXTRALIBDIRS =
  43. cpfirmware: warn-arm_atsam
  44. .INTERMEDIATE: warn-arm_atsam
  45. warn-arm_atsam: $(FIRMWARE_FORMAT)
  46. $(info @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@)
  47. $(info This MCU support package has a lack of support from the upstream provider (Massdrop).)
  48. $(info There are currently questions about valid licensing, and at this stage it's likely)
  49. $(info their boards and supporting code will be removed from QMK in the near future. Please)
  50. $(info contact Massdrop for support, and encourage them to align their future board design)
  51. $(info choices to gain proper license compatibility with QMK.)
  52. $(info @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@)
  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;