diff options
author | Jun Wako <wakojun@gmail.com> | 2015-04-24 16:26:14 +0900 |
---|---|---|
committer | Jun Wako <wakojun@gmail.com> | 2015-04-24 16:26:14 +0900 |
commit | a3d96d3aa96318d339a67de1085e0ae495d57c84 (patch) | |
tree | db85c16d03b52399d6c109eda7ea0341a0de0b1d /tmk_core/tool/mbed/mbed-sdk/workspace_tools/export/codesourcery_arch_pro.tmpl | |
parent | 1d5bac21dc6f1425b8ef4bbe7935330c37c3a93e (diff) | |
parent | 1fe4406f374291ab2e86e95a97341fd9c475fcb8 (diff) |
Merge commit '1fe4406f374291ab2e86e95a97341fd9c475fcb8'
Diffstat (limited to 'tmk_core/tool/mbed/mbed-sdk/workspace_tools/export/codesourcery_arch_pro.tmpl')
-rw-r--r-- | tmk_core/tool/mbed/mbed-sdk/workspace_tools/export/codesourcery_arch_pro.tmpl | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/tmk_core/tool/mbed/mbed-sdk/workspace_tools/export/codesourcery_arch_pro.tmpl b/tmk_core/tool/mbed/mbed-sdk/workspace_tools/export/codesourcery_arch_pro.tmpl new file mode 100644 index 0000000000..161bd1b7ba --- /dev/null +++ b/tmk_core/tool/mbed/mbed-sdk/workspace_tools/export/codesourcery_arch_pro.tmpl @@ -0,0 +1,56 @@ +# This file was automagically generated by mbed.org. For more information, +# see http://mbed.org/handbook/Exporting-to-CodeSourcery + +GCC_BIN = +PROJECT = {{name}} +OBJECTS = {% for f in to_be_compiled %}{{f}} {% endfor %} +SYS_OBJECTS = {% for f in object_files %}{{f}} {% endfor %} +INCLUDE_PATHS = {% for p in include_paths %}-I{{p}} {% endfor %} +LIBRARY_PATHS = {% for p in library_paths %}-L{{p}} {% endfor %} +LIBRARIES = {% for lib in libraries %}-l{{lib}} {% endfor %} +LINKER_SCRIPT = {{linker_script}} + +############################################################################### +CC = $(GCC_BIN)arm-none-eabi-gcc +CPP = $(GCC_BIN)arm-none-eabi-g++ +CC_FLAGS = -c -g -fno-common -fmessage-length=0 -Wall -fno-exceptions -fno-rtti -mcpu=cortex-m3 -mthumb -ffunction-sections -fdata-sections -fomit-frame-pointer +ONLY_C_FLAGS = -std=gnu99 +ONLY_CPP_FLAGS = -std=gnu++98 +CC_SYMBOLS = {% for s in symbols %}-D{{s}} {% endfor %} + + +AS = $(GCC_BIN)arm-none-eabi-as + +LD = $(GCC_BIN)arm-none-eabi-gcc +LD_FLAGS = -mcpu=cortex-m3 -mthumb -Wl,--gc-sections +LD_SYS_LIBS = -lstdc++ -lsupc++ -lm -lc -lgcc + +OBJCOPY = $(GCC_BIN)arm-none-eabi-objcopy + +ifeq ($(DEBUG), 1) + CC_FLAGS += -DDEBUG -O0 +else + CC_FLAGS += -DNDEBUG -Os +endif + +all: $(PROJECT).bin + +clean: + rm -f $(PROJECT).bin $(PROJECT).elf $(OBJECTS) + +.s.o: + $(AS) $(CC_FLAGS) $(CC_SYMBOLS) -o $@ $< + +.c.o: + $(CC) $(CC_FLAGS) $(CC_SYMBOLS) $(ONLY_C_FLAGS) $(INCLUDE_PATHS) -o $@ $< + +.cpp.o: + $(CPP) $(CC_FLAGS) $(CC_SYMBOLS) $(ONLY_CPP_FLAGS) $(INCLUDE_PATHS) -o $@ $< + + +$(PROJECT).elf: $(OBJECTS) $(SYS_OBJECTS) + $(LD) $(LD_FLAGS) -T$(LINKER_SCRIPT) $(LIBRARY_PATHS) -o $@ $^ $(LIBRARIES) $(LD_SYS_LIBS) $(LIBRARIES) $(LD_SYS_LIBS) + +$(PROJECT).bin: $(PROJECT).elf + $(OBJCOPY) -O binary $< $@ + |