Keyboard firmwares for Atmel AVR and Cortex-M
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

gcc_arm_kl25z.tmpl 2.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. # This file was automagically generated by mbed.org. For more information,
  2. # see http://mbed.org/handbook/Exporting-to-GCC-ARM-Embedded
  3. GCC_BIN =
  4. PROJECT = {{name}}
  5. OBJECTS = {% for f in to_be_compiled %}{{f}} {% endfor %}
  6. SYS_OBJECTS = {% for f in object_files %}{{f}} {% endfor %}
  7. INCLUDE_PATHS = {% for p in include_paths %}-I{{p}} {% endfor %}
  8. LIBRARY_PATHS = {% for p in library_paths %}-L{{p}} {% endfor %}
  9. LIBRARIES = {% for lib in libraries %}-l{{lib}} {% endfor %}
  10. LINKER_SCRIPT = {{linker_script}}
  11. ###############################################################################
  12. AS = $(GCC_BIN)arm-none-eabi-as
  13. CC = $(GCC_BIN)arm-none-eabi-gcc
  14. CPP = $(GCC_BIN)arm-none-eabi-g++
  15. LD = $(GCC_BIN)arm-none-eabi-gcc
  16. OBJCOPY = $(GCC_BIN)arm-none-eabi-objcopy
  17. OBJDUMP = $(GCC_BIN)arm-none-eabi-objdump
  18. SIZE = $(GCC_BIN)arm-none-eabi-size
  19. CPU = -mcpu=cortex-m0plus -mthumb
  20. CC_FLAGS = $(CPU) -c -g -fno-common -fmessage-length=0 -Wall -fno-exceptions -ffunction-sections -fdata-sections -fomit-frame-pointer
  21. CC_FLAGS += -MMD -MP
  22. CC_SYMBOLS = {% for s in symbols %}-D{{s}} {% endfor %}
  23. LD_FLAGS = $(CPU) -Wl,--gc-sections --specs=nano.specs -u _printf_float -u _scanf_float -Wl,--wrap,main
  24. LD_FLAGS += -Wl,-Map=$(PROJECT).map,--cref
  25. LD_SYS_LIBS = -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys
  26. ifeq ($(DEBUG), 1)
  27. CC_FLAGS += -DDEBUG -O0
  28. else
  29. CC_FLAGS += -DNDEBUG -Os
  30. endif
  31. all: $(PROJECT).bin $(PROJECT).hex
  32. clean:
  33. rm -f $(PROJECT).bin $(PROJECT).elf $(PROJECT).hex $(PROJECT).map $(PROJECT).lst $(OBJECTS) $(DEPS)
  34. .s.o:
  35. $(AS) $(CPU) -o $@ $<
  36. .c.o:
  37. $(CC) $(CC_FLAGS) $(CC_SYMBOLS) -std=gnu99 $(INCLUDE_PATHS) -o $@ $<
  38. .cpp.o:
  39. $(CPP) $(CC_FLAGS) $(CC_SYMBOLS) -std=gnu++98 -fno-rtti $(INCLUDE_PATHS) -o $@ $<
  40. $(PROJECT).elf: $(OBJECTS) $(SYS_OBJECTS)
  41. $(LD) $(LD_FLAGS) -T$(LINKER_SCRIPT) $(LIBRARY_PATHS) -o $@ $^ $(LIBRARIES) $(LD_SYS_LIBS) $(LIBRARIES) $(LD_SYS_LIBS)
  42. $(SIZE) $@
  43. $(PROJECT).bin: $(PROJECT).elf
  44. @$(OBJCOPY) -O binary $< $@
  45. $(PROJECT).hex: $(PROJECT).elf
  46. @$(OBJCOPY) -O ihex $< $@
  47. $(PROJECT).lst: $(PROJECT).elf
  48. @$(OBJDUMP) -Sdh $< > $@
  49. lst: $(PROJECT).lst
  50. size:
  51. $(SIZE) $(PROJECT).elf
  52. DEPS = $(OBJECTS:.o=.d) $(SYS_OBJECTS:.o=.d)
  53. -include $(DEPS)