platform.mk 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. # Hey Emacs, this is a -*- makefile -*-
  2. ##############################################################################
  3. # Compiler settings
  4. #
  5. CC = $(CC_PREFIX) 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. COMPILEFLAGS += -fno-builtin-printf
  26. #ALLOW_WARNINGS = yes
  27. CFLAGS += $(COMPILEFLAGS)
  28. CXXFLAGS += $(COMPILEFLAGS)
  29. CXXFLAGS += -fno-exceptions $(CXXSTANDARD)
  30. LDFLAGS +=-Wl,--gc-sections
  31. LDFLAGS += -Wl,-Map="%OUT%%PROJ_NAME%.map"
  32. LDFLAGS += -Wl,--start-group
  33. LDFLAGS += -Wl,--end-group
  34. LDFLAGS += --specs=rdimon.specs
  35. LDFLAGS += -T$(LIB_PATH)/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/gcc/gcc/samd51j18a_flash.ld
  36. OPT_DEFS += -DPROTOCOL_ARM_ATSAM
  37. MCUFLAGS = -mcpu=$(MCU)
  38. MCUFLAGS += -D__$(ARM_ATSAM)__
  39. # List any extra directories to look for libraries here.
  40. # Each directory must be seperated by a space.
  41. # Use forward slashes for directory separators.
  42. # For a directory that has spaces, enclose it in quotes.
  43. EXTRALIBDIRS =
  44. cpfirmware: warn-arm_atsam
  45. .INTERMEDIATE: warn-arm_atsam
  46. warn-arm_atsam: $(FIRMWARE_FORMAT)
  47. $(info @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@)
  48. $(info This MCU support package has a lack of support from the upstream provider (Massdrop).)
  49. $(info There are currently questions about valid licensing, and at this stage it's likely)
  50. $(info their boards and supporting code will be removed from QMK in the near future. Please)
  51. $(info contact Massdrop for support, and encourage them to align their future board design)
  52. $(info choices to gain proper license compatibility with QMK.)
  53. $(info @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@)
  54. # Convert hex to bin.
  55. bin: $(BUILD_DIR)/$(TARGET).hex
  56. $(OBJCOPY) -Iihex -Obinary $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).bin
  57. $(COPY) $(BUILD_DIR)/$(TARGET).bin $(TARGET).bin;