Skip to content

Commit

Permalink
[make] Fix missing outpath for custom flag files
Browse files Browse the repository at this point in the history
  • Loading branch information
salkinium committed Jul 20, 2022
1 parent b37d351 commit 79da694
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions tools/build_script_generator/make/resources/config.mk.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
profile?=release
BUILDPATH_PREFIX := {{ build_path }}/make-
BUILDPATH := $(BUILDPATH_PREFIX)$(profile)
OUTPATH := {{outpath}}
MODM_PROJECT_NAME := {{ options[":build:project.name"] }}

ELF_FILE := $(BUILDPATH)/$(MODM_PROJECT_NAME).{{program_extension}}
Expand Down Expand Up @@ -133,22 +134,22 @@ compile_asm = \
$(BUILDPATH)/%.o : %.c
@$(call compile_c,$@,$<,)
%% if outpath != "."
$(BUILDPATH)/%.o : {{outpath}}/%.c
$(BUILDPATH)/%.o : $(OUTPATH)/%.c
@$(call compile_c,$@,$<,)
%% endif
%% for suffix in ["cc", "cpp", "cxx", "c++"]
$(BUILDPATH)/%.o : %.{{suffix}}
@$(call compile_cpp,$@,$<,)
%% if outpath != "."
$(BUILDPATH)/%.o : {{outpath}}/%.{{suffix}}
$(BUILDPATH)/%.o : $(OUTPATH)/%.{{suffix}}
@$(call compile_cpp,$@,$<,)
%% endif
%% endfor
%% for suffix in ["sx", "s", "S"]
$(BUILDPATH)/%.o : %.{{suffix}}
@$(call compile_asm,$@,$<,)
%% if outpath != "."
$(BUILDPATH)/%.o : {{outpath}}/%.{{suffix}}
$(BUILDPATH)/%.o : $(OUTPATH)/%.{{suffix}}
@$(call compile_asm,$@,$<,)
%% endif
%% endfor
Expand Down
2 changes: 1 addition & 1 deletion tools/build_script_generator/make/resources/repo.mk.in
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ CPPDEFINES += \
# Custom build rules for repo sources
%% for file, flags in sources
%% if flags | length
$(BUILDPATH)/{{ file | objectify }}: {{ file }}
$(BUILDPATH)/{{ file | objectify }}: $(OUTPATH)/{{ file }}
%% set ext = {"sx":"asm","s":"asm","S":"asm"}.get(file.split(".")[-1],file.split(".")[-1])
@$(call compile_{{ ext }},$@,$<,{% for key, profiles in flags.items() if "" in profiles %} {{ profiles[""] | join(" ") }}{% endfor %} \
%% for key, profiles in flags.items()
Expand Down

0 comments on commit 79da694

Please sign in to comment.