diff --git a/tools/export/makefile/Makefile.tmpl b/tools/export/makefile/Makefile.tmpl index eb2ebbddd2..0081934c08 100644 --- a/tools/export/makefile/Makefile.tmpl +++ b/tools/export/makefile/Makefile.tmpl @@ -42,8 +42,6 @@ VPATH = {{vpath|join(" ")}} PROJECT := {{name}} -{% for sym in symbols %}CC_SYMBOLS += -D{{sym}} -{% endfor %} # Project settings ############################################################################### @@ -74,6 +72,13 @@ SREC_CAT = srec_cat {%- endif %} {%- block additional_executables -%}{%- endblock %} +{% for flag in c_flags %}C_FLAGS += {{flag}} +{% endfor %} +{% for flag in cxx_flags %}CXX_FLAGS += {{flag}} +{% endfor %} +{% for flag in asm_flags %}ASM_FLAGS += {{flag}} +{% endfor %} + LD_FLAGS :={%- block ld_flags -%} {{ld_flags|join(" ")}} {% endblock %} {% block sys_libs -%}{%- endblock %} @@ -91,21 +96,21 @@ all: $(PROJECT).bin $(PROJECT).hex size .asm.o: +@$(call MAKEDIR,$(dir $@)) - $(AS) -c $(CC_SYMBOLS) $(INCLUDE_PATHS) -o $@ $< + $(AS) -c $(ASM_FLAGS) $(INCLUDE_PATHS) -o $@ $< .s.o: +@$(call MAKEDIR,$(dir $@)) - $(AS) -c $(CC_SYMBOLS) $(INCLUDE_PATHS) -o $@ $< + $(AS) -c $(ASM_FLAGS) $(INCLUDE_PATHS) -o $@ $< .S.o: +@$(call MAKEDIR,$(dir $@)) - $(AS) -c $(CC_SYMBOLS) $(INCLUDE_PATHS) -o $@ $< + $(AS) -c $(ASM_FLAGS) $(INCLUDE_PATHS) -o $@ $< .c.o: +@$(call MAKEDIR,$(dir $@)) - $(CC) $(CC_SYMBOLS) $(INCLUDE_PATHS) -o $@ $< + $(CC) $(C_FLAGS) $(INCLUDE_PATHS) -o $@ $< .cpp.o: +@$(call MAKEDIR,$(dir $@)) - $(CPP) $(CC_SYMBOLS) $(INCLUDE_PATHS) -o $@ $< + $(CPP) $(CXX_FLAGS) $(INCLUDE_PATHS) -o $@ $< {% block target_project_elf %} $(PROJECT).elf: $(OBJECTS) $(SYS_OBJECTS) $(LINKER_SCRIPT) diff --git a/tools/export/makefile/__init__.py b/tools/export/makefile/__init__.py index d59fa8e491..69e01a8c42 100644 --- a/tools/export/makefile/__init__.py +++ b/tools/export/makefile/__init__.py @@ -40,9 +40,9 @@ class Makefile(Exporter): self.resources.win_to_unix() to_be_compiled = [splitext(src)[0] + ".o" for src in - self.resources['s_sources'] + - self.resources['c_sources'] + - self.resources['cpp_sources']] + self.resources.s_sources + + self.resources.c_sources + + self.resources.cpp_sources] libraries = [splitext(lib)[0][3:] for lib in self.resources.libraries] @@ -54,7 +54,6 @@ class Makefile(Exporter): 'library_paths': self.resources.lib_dirs, 'linker_script': self.resources.linker_script, 'libraries': libraries, - 'symbols': self.toolchain.get_symbols(), 'hex_files': self.resources.hex_files, 'vpath': (["../../.."] if (basename(dirname(dirname(self.export_dir))) @@ -78,7 +77,7 @@ class Makefile(Exporter): if "../." not in ctx["include_paths"]: ctx["include_paths"] += ['../.'] for key in ['include_paths', 'library_paths', 'hex_files', - 'to_be_compiled', 'symbols']: + 'to_be_compiled']: ctx[key] = sorted(ctx[key]) ctx.update(self.flags)