]> git.gir.st - tmk_keyboard.git/blob - tool/mbed/mbed-sdk/workspace_tools/export/gcc_arm_nrf51_dk.tmpl
Squashed 'tmk_core/' changes from 7967731..b9e0ea0
[tmk_keyboard.git] / tool / mbed / mbed-sdk / workspace_tools / export / gcc_arm_nrf51_dk.tmpl
1 # This file was automagically generated by mbed.org. For more information,
2 # see http://mbed.org/handbook/Exporting-to-GCC-ARM-Embedded
3
4 GCC_BIN =
5 PROJECT = {{name}}
6 OBJECTS = {% for f in to_be_compiled %}{{f}} {% endfor %}
7 SYS_OBJECTS = {% for f in object_files %}{{f}} {% endfor %}
8 INCLUDE_PATHS = {% for p in include_paths %}-I{{p}} {% endfor %}
9 LIBRARY_PATHS = {% for p in library_paths %}-L{{p}} {% endfor %}
10 LIBRARIES = {% for lib in libraries %}-l{{lib}} {% endfor %}
11 LINKER_SCRIPT = {{linker_script}}
12 SOFTDEVICE = mbed/TARGET_NRF51_DK/TARGET_NORDIC/TARGET_MCU_NRF51822/Lib/s110_nrf51822_7_1_0/s110_nrf51822_7.1.0_softdevice.hex
13
14 ###############################################################################
15 AS = $(GCC_BIN)arm-none-eabi-as
16 CC = $(GCC_BIN)arm-none-eabi-gcc
17 CPP = $(GCC_BIN)arm-none-eabi-g++
18 LD = $(GCC_BIN)arm-none-eabi-gcc
19 OBJCOPY = $(GCC_BIN)arm-none-eabi-objcopy
20 OBJDUMP = $(GCC_BIN)arm-none-eabi-objdump
21 SIZE = $(GCC_BIN)arm-none-eabi-size
22 SREC_CAT = srec_cat
23
24 CPU = -mcpu=cortex-m0 -mthumb
25 CC_FLAGS = $(CPU) -c -g -fno-common -fmessage-length=0 -Wall -fno-exceptions -ffunction-sections -fdata-sections -fomit-frame-pointer
26 CC_FLAGS += -MMD -MP
27 CC_SYMBOLS = {% for s in symbols %}-D{{s}} {% endfor %}
28
29 LD_FLAGS = $(CPU) -Wl,--gc-sections -Wl,--wrap=main --specs=nano.specs -u _printf_float -u _scanf_float
30 LD_FLAGS += -Wl,-Map=$(PROJECT).map,--cref
31 LD_SYS_LIBS = -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys
32
33 ifeq ($(DEBUG), 1)
34 CC_FLAGS += -DDEBUG -O0
35 else
36 CC_FLAGS += -DNDEBUG -Os
37 endif
38
39 all: $(PROJECT).bin $(PROJECT).hex
40
41 clean:
42 rm -f $(PROJECT).bin $(PROJECT).elf $(PROJECT).hex $(PROJECT).map $(PROJECT).lst $(OBJECTS) $(DEPS)
43
44 .s.o:
45 $(AS) $(CPU) -o $@ $<
46
47 .c.o:
48 $(CC) $(CC_FLAGS) $(CC_SYMBOLS) -std=gnu99 $(INCLUDE_PATHS) -o $@ $<
49
50 .cpp.o:
51 $(CPP) $(CC_FLAGS) $(CC_SYMBOLS) -std=gnu++98 -fno-rtti $(INCLUDE_PATHS) -o $@ $<
52
53
54 $(PROJECT).elf: $(OBJECTS) $(SYS_OBJECTS)
55 $(LD) $(LD_FLAGS) -T$(LINKER_SCRIPT) $(LIBRARY_PATHS) -o $@ $^ $(LIBRARIES) $(LD_SYS_LIBS) $(LIBRARIES) $(LD_SYS_LIBS)
56 $(SIZE) $@
57
58 $(PROJECT).bin: $(PROJECT).elf
59 @$(OBJCOPY) -O binary $< $@
60
61 $(PROJECT).hex: $(PROJECT).elf
62 @$(OBJCOPY) -O ihex $< $@
63
64 $(PROJECT).lst: $(PROJECT).elf
65 @$(OBJDUMP) -Sdh $< > $@
66
67 lst: $(PROJECT).lst
68
69 size:
70 $(SIZE) $(PROJECT).elf
71
72 DEPS = $(OBJECTS:.o=.d) $(SYS_OBJECTS:.o=.d)
73 -include $(DEPS)
74
75 merge:
76 $(SREC_CAT) $(SOFTDEVICE) -intel $(PROJECT).hex -intel -o combined.hex -intel --line-length=44
Imprint / Impressum