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_rz_a1h.tmpl 2.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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-a9 -mthumb-interwork -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard
  20. CC_FLAGS = $(CPU) -c -g -fno-common -fmessage-length=0 -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers
  21. CC_FLAGS += -fno-exceptions -fno-builtin -ffunction-sections -fdata-sections -fno-delete-null-pointer-checks -fomit-frame-pointer
  22. CC_FLAGS += -MMD -MP -mno-unaligned-access
  23. CC_SYMBOLS = {% for s in symbols %}-D{{s}} {% endfor %}
  24. LD_FLAGS = $(CPU) -Wl,--gc-sections --specs=nano.specs -u _printf_float -u _scanf_float -Wl,--wrap,main
  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. @echo ""
  44. @echo "*****"
  45. @echo "***** You must modify vector checksum value in *.bin and *.hex files."
  46. @echo "*****"
  47. @echo ""
  48. $(SIZE) $@
  49. $(PROJECT).bin: $(PROJECT).elf
  50. @$(OBJCOPY) -O binary $< $@
  51. $(PROJECT).hex: $(PROJECT).elf
  52. @$(OBJCOPY) -O ihex $< $@
  53. $(PROJECT).lst: $(PROJECT).elf
  54. @$(OBJDUMP) -Sdh $< > $@
  55. lst: $(PROJECT).lst
  56. size:
  57. $(SIZE) $(PROJECT).elf
  58. DEPS = $(OBJECTS:.o=.d) $(SYS_OBJECTS:.o=.d)
  59. -include $(DEPS)