summaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2022-05-26 11:55:51 +0200
committerDavid Lamparter <equinox@opensourcerouting.org>2022-05-26 16:11:12 +0200
commite8422835f2dc6cfe718ad47b7d99fab5180b603d (patch)
tree435c92800a07d6fdb2660dcf71d6b67211a00d18 /python
parentMerge pull request #11281 from opensourcerouting/fix/gh_actions (diff)
downloadfrr-e8422835f2dc6cfe718ad47b7d99fab5180b603d.tar.xz
frr-e8422835f2dc6cfe718ad47b7d99fab5180b603d.zip
build: fix LLVM bitcode per-target CFLAGS
When automake decides to customize CFLAGS, use those for building LLVM bitcode files too. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'python')
-rw-r--r--python/makefile.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/python/makefile.py b/python/makefile.py
index 44658013b..64d02bbe5 100644
--- a/python/makefile.py
+++ b/python/makefile.py
@@ -113,10 +113,19 @@ while lines:
target, dep = m.group(1), m.group(2)
+ filename = os.path.basename(target)
+ if '-' in filename:
+ am_name, _ = filename.split('-', 1)
+ am_name = os.path.join(os.path.dirname(target), am_name)
+ am_name = am_name.replace('/', '_')
+ extraflags = " $(%s_CFLAGS)" % (am_name,)
+ else:
+ extraflags = ""
+
if target.endswith(".lo") or target.endswith(".o"):
if not dep.endswith(".h"):
bcdeps.append("%s.bc: %s" % (target, target))
- bcdeps.append("\t$(AM_V_LLVM_BC)$(COMPILE) -emit-llvm -c -o $@ %s" % (dep))
+ bcdeps.append("\t$(AM_V_LLVM_BC)$(COMPILE)%s -emit-llvm -c -o $@ %s" % (extraflags, dep))
if m.group(2) in clippy_scan:
out_lines.append(
clippyauxdep.substitute(target=m.group(1), clippybase=m.group(2)[:-2])