Skip to content

Commit e439b85

Browse files
committed
prepend VPATH to preinclude and don't escape asm macros
1 parent 675ca1a commit e439b85

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
@@ -126,8 +126,15 @@ def generate(self):
126126
ctx.update(self.format_flags())
127127

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

132139
for templatefile in \
133140
['makefile/%s_%s.tmpl' % (self.TEMPLATE,
@@ -148,7 +155,7 @@ def format_flags(self):
148155
"""Format toolchain flags for Makefile"""
149156
flags = {}
150157
for k, v in self.flags.items():
151-
if k in ['asm_flags', 'c_flags', 'cxx_flags']:
158+
if k in ['c_flags', 'cxx_flags']:
152159
flags[k] = map(lambda x: x.replace('"', '\\"'), v)
153160
else:
154161
flags[k] = v

0 commit comments

Comments
 (0)