Skip to content

Commit 6935ae2

Browse files
theotherjimmyCruz Monrreal II
authored andcommitted
prepend VPATH to preinclude and don't escape asm macros
1 parent d6ef499 commit 6935ae2

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

tools/export/makefile/__init__.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,15 @@ def generate(self):
124124
ctx.update(self.format_flags())
125125

126126
# Add the virtual path the the include option in the ASM flags
127-
ctx['asm_flags'] = map(lambda item: "-I" + ctx['vpath'][0] + "/" + item[2:]
128-
if item.startswith('-I') else item, ctx['asm_flags'])
127+
new_asm_flags = []
128+
for flag in ctx['asm_flags']:
129+
if flag.startswith('-I'):
130+
new_asm_flags.append("-I{}/{}".format(ctx['vpath'][0], flag[2:]))
131+
elif flag.startswith('--preinclude='):
132+
new_asm_flags.append("--preinclude={}/{}".format(ctx['vpath'][0], flag[13:]))
133+
else:
134+
new_asm_flags.append(flag)
135+
ctx['asm_flags'] = new_asm_flags
129136

130137
for templatefile in \
131138
['makefile/%s_%s.tmpl' % (self.TEMPLATE,
@@ -146,7 +153,7 @@ def format_flags(self):
146153
"""Format toolchain flags for Makefile"""
147154
flags = {}
148155
for k, v in self.flags.items():
149-
if k in ['asm_flags', 'c_flags', 'cxx_flags']:
156+
if k in ['c_flags', 'cxx_flags']:
150157
flags[k] = map(lambda x: x.replace('"', '\\"'), v)
151158
else:
152159
flags[k] = v

0 commit comments

Comments
 (0)