diff options
| author | David Lamparter <equinox@diac24.net> | 2020-05-01 15:22:05 +0200 |
|---|---|---|
| committer | David Lamparter <equinox@diac24.net> | 2020-05-05 14:06:42 +0200 |
| commit | 599943954969adb2b69618b943e44c62ae3ce4d2 (patch) | |
| tree | a6344db264ac0215afbfb97acafb5650fcb53c1a /python/makefile.py | |
| parent | 15e9c561b2a10e90b1370e7a8d43d02ffde9e61a (diff) | |
build: rework Makefile var extraction... again
*sigh* I can't seem to catch a break on this. Add a regex variant.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'python/makefile.py')
| -rw-r--r-- | python/makefile.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/python/makefile.py b/python/makefile.py index 9af397d373..e60c8aadbc 100644 --- a/python/makefile.py +++ b/python/makefile.py @@ -11,6 +11,7 @@ import subprocess import re import argparse from string import Template +from makevars import MakeReVars argp = argparse.ArgumentParser(description = 'FRR Makefile extensions') argp.add_argument('--dev-build', action = 'store_const', const = True, @@ -20,13 +21,9 @@ args = argp.parse_args() with open('Makefile', 'r') as fd: before = fd.read() -nolinecont = before.replace('\\\n', '') -m = re.search('^clippy_scan\s*=([^#]*)(?:#.*)?$', nolinecont, flags=re.MULTILINE) -if m is None: - sys.stderr.write('failed to parse Makefile.in\n') - sys.exit(2) +mv = MakeReVars(before) -clippy_scan = m.group(1).strip().split() +clippy_scan = mv['clippy_scan'].strip().split() for clippy_file in clippy_scan: assert clippy_file.endswith('.c') |
