]> git.gir.st - tmk_keyboard.git/blob - tool/mbed/mbed-sdk/workspace_tools/export/gcc_arm_lpc2368.tmpl
Squashed 'tmk_core/' changes from 7967731..b9e0ea0
[tmk_keyboard.git] / tool / mbed / mbed-sdk / workspace_tools / export / gcc_arm_lpc2368.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
13 ###############################################################################
14 AS = $(GCC_BIN)arm-none-eabi-as
15 CC = $(GCC_BIN)arm-none-eabi-gcc
16 CPP = $(GCC_BIN)arm-none-eabi-g++
17 LD = $(GCC_BIN)arm-none-eabi-gcc
18 OBJCOPY = $(GCC_BIN)arm-none-eabi-objcopy
19 OBJDUMP = $(GCC_BIN)arm-none-eabi-objdump
20 SIZE = $(GCC_BIN)arm-none-eabi-size
21
22 CPU = -mcpu=arm7tdmi-s
23 CC_FLAGS = $(CPU) -c -g -fno-common -fmessage-length=0 -Wall -fno-exceptions -ffunction-sections -fdata-sections -fomit-frame-pointer
24 CC_FLAGS += -MMD -MP
25 CC_SYMBOLS = {% for s in symbols %}-D{{s}} {% endfor %}
26
27 LD_FLAGS = $(CPU) -Wl,--gc-sections --specs=nano.specs -u _printf_float -u _scanf_float -Wl,--wrap,main
28 LD_FLAGS += -Wl,-Map=$(PROJECT).map,--cref -Wl,--entry=_start
29 LD_SYS_LIBS = -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys
30
31 ifeq ($(DEBUG), 1)
32 CC_FLAGS += -DDEBUG -O0
33 else
34 CC_FLAGS += -DNDEBUG -Os
35 endif
36
37 all: $(PROJECT).bin $(PROJECT).hex
38
39 clean:
40 rm -f $(PROJECT).bin $(PROJECT).elf $(PROJECT).hex $(PROJECT).map $(PROJECT).lst $(OBJECTS) $(DEPS)
41
42 .s.o:
43 $(AS) $(CPU) -o $@ $<
44
45 .c.o:
46 $(CC) $(CC_FLAGS) $(CC_SYMBOLS) -std=gnu99 $(INCLUDE_PATHS) -o $@ $<
47
48 .cpp.o:
49 $(CPP) $(CC_FLAGS) $(CC_SYMBOLS) -std=gnu++98 -fno-rtti $(INCLUDE_PATHS) -o $@ $<
50
51
52 $(PROJECT).elf: $(OBJECTS) $(SYS_OBJECTS)
53 $(LD) $(LD_FLAGS) -T$(LINKER_SCRIPT) $(LIBRARY_PATHS) -o $@ $^ $(LIBRARIES) $(LD_SYS_LIBS) $(LIBRARIES) $(LD_SYS_LIBS)
54 $(SIZE) $@
55
56 $(PROJECT).bin: $(PROJECT).elf
57 @$(OBJCOPY) -O binary $< $@
58
59 $(PROJECT).hex: $(PROJECT).elf
60 @$(OBJCOPY) -O ihex $< $@
61
62 $(PROJECT).lst: $(PROJECT).elf
63 @$(OBJDUMP) -Sdh $< > $@
64
65 lst: $(PROJECT).lst
66
67 size:
68 $(SIZE) $(PROJECT).elf
69
70 DEPS = $(OBJECTS:.o=.d) $(SYS_OBJECTS:.o=.d)
71 -include $(DEPS)
72
Imprint / Impressum