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_disco_f100rb.tmpl 2.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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-m3 -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 -Wl,--wrap,main
  24. #LD_FLAGS += -u _printf_float -u _scanf_float
  25. LD_FLAGS += -Wl,-Map=$(PROJECT).map,--cref
  26. LD_SYS_LIBS = -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys
  27. ifeq ($(DEBUG), 1)
  28. CC_FLAGS += -DDEBUG -O0
  29. else
  30. CC_FLAGS += -DNDEBUG -Os
  31. endif
  32. all: $(PROJECT).bin $(PROJECT).hex
  33. clean:
  34. rm -f $(PROJECT).bin $(PROJECT).elf $(PROJECT).hex $(PROJECT).map $(PROJECT).lst $(OBJECTS) $(DEPS)
  35. .s.o:
  36. $(AS) $(CPU) -o $@ $<
  37. .c.o:
  38. $(CC) $(CC_FLAGS) $(CC_SYMBOLS) -std=gnu99 $(INCLUDE_PATHS) -o $@ $<
  39. .cpp.o:
  40. $(CPP) $(CC_FLAGS) $(CC_SYMBOLS) -std=gnu++98 -fno-rtti $(INCLUDE_PATHS) -o $@ $<
  41. $(PROJECT).elf: $(OBJECTS) $(SYS_OBJECTS)
  42. $(LD) $(LD_FLAGS) -T$(LINKER_SCRIPT) $(LIBRARY_PATHS) -o $@ $^ $(LIBRARIES) $(LD_SYS_LIBS) $(LIBRARIES) $(LD_SYS_LIBS)
  43. $(SIZE) $@
  44. $(PROJECT).bin: $(PROJECT).elf
  45. @$(OBJCOPY) -O binary $< $@
  46. $(PROJECT).hex: $(PROJECT).elf
  47. @$(OBJCOPY) -O ihex $< $@
  48. $(PROJECT).lst: $(PROJECT).elf
  49. @$(OBJDUMP) -Sdh $< > $@
  50. lst: $(PROJECT).lst
  51. size:
  52. $(SIZE) $(PROJECT).elf
  53. DEPS = $(OBJECTS:.o=.d) $(SYS_OBJECTS:.o=.d)
  54. -include $(DEPS)