Makefile.k82f 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. VPATH += :$(HALPATH)/k82f
  2. TMPSRC += $(wildcard $(HALPATH)/k82f/*.c)
  3. DVRSRC += $(wildcard $(HALPATH)/k82f/Drivers/*.c)
  4. SRC += $(subst $(HALPATH)/k82f/,,$(TMPSRC))
  5. $(info SRC is $(SRC))
  6. EXTRAINCDIRS += $(HALPATH)/k82f $(HALPATH)/k82f/CMSIS $(HALPATH)/k82f/Drivers
  7. ASRC += startup_MK82F25615.S
  8. #MCU_FLAGS = -mcpu=cortex-m4
  9. CC = arm-none-eabi-gcc
  10. OBJCOPY = arm-none-eabi-objcopy
  11. OBJDUMP = arm-none-eabi-objdump
  12. SIZE = arm-none-eabi-size
  13. AR = arm-none-eabi-ar rcs
  14. NM = arm-none-eabi-nm
  15. #Output Format = Binary for this target
  16. FORMAT = binary
  17. CFLAGS += -Os -g -DDEBUG -DCPU_MK82FN256VLL15 -w -fno-common -ffunction-sections -fdata-sections -ffreestanding -fno-builtin
  18. CFLAGS += -mthumb -mapcs -std=gnu99 -mcpu=cortex-m4 -MMD -MP -static -mfloat-abi=soft
  19. CPPFLAGS += -mthumb -mapcs -std=gnu99 -mcpu=cortex-m4 -MMD -MP -static -mfloat-abi=soft
  20. CPPFLAGS += -Os -g -DDEBUG -DCPU_MK82FN256VLL15 -DFRDM_K64F -DFREEDOM -w -fno-common -ffunction-sections -fdata-sections -ffreestanding -fno-builtin
  21. ifeq ($(ETM_ENABLE),1)
  22. CFLAGS += -DETM_ENABLE=1
  23. endif
  24. ifeq ($(CRYPTO_TARGET),HWAES)
  25. ifeq ($(CRYPTO_OPTIONS),LTC)
  26. $(info Using hardware masked Trusted Crypto engine)
  27. CFLAGS += -DUSE_TRUSTED_CRYPTO=1
  28. CPPFLAGS += -DUSE_TRUSTED_CRYPTO=1
  29. else ifeq ($(CRYPTO_OPTIONS),MMCAU)
  30. $(info Using normal hardware crypto engine)
  31. CFLAGS += -DUSE_TRUSTED_CRYPTO=0
  32. CPPFLAGS += -DUSE_TRUSTED_CRYPTO=0
  33. else
  34. $(error Unsupported crypto engine. Set CRYPTO_OPTIONS to either MMCAU or LTC)
  35. endif
  36. endif
  37. ASFLAGS += -g -DDEBUG -D__STARTUP_CLEAR_BSS -g -Wall -fno-common -ffunction-sections -fdata-sections -ffreestanding -fno-builtin
  38. ASFLAGS += -mthumb -mapcs -std=gnu99 -mcpu=cortex-m4 -mfloat-abi=soft
  39. LDFLAGS += -Xlinker --gc-sections -Xlinker -static -Xlinker -z -Xlinker muldefs -T $(HALPATH)/k82f/MK82FN256xxx15_flash.ld
  40. LDFLAGS += --specs=nano.specs --specs=nosys.specs -Wl,--start-group -L $(HALPATH)/k82f/ -l:lib_mmcau.a -lm -lc -lgcc -lnosys -Wl,--end-group