| 75 | |
| 76 | |
| 77 | def dry_commands(target: str, extra: list[str]) -> list[list[str]]: |
| 78 | res = subprocess.run(["make", "-f", "Makefile.cbm", "-n", "-B", target] + extra, |
| 79 | cwd=ROOT, capture_output=True, text=True, check=False) |
| 80 | cmds = [] |
| 81 | for line in res.stdout.replace("\\\n", " ").splitlines(): |
| 82 | try: |
| 83 | argv = shlex.split(line) |
| 84 | except ValueError: |
| 85 | continue |
| 86 | if argv and any(a.endswith(SRC_EXT) for a in argv) and ("-c" in argv or "-o" in argv): |
| 87 | cmds.append(argv) |
| 88 | return cmds |
| 89 | |
| 90 | |
| 91 | def make_var(name: str) -> list[str]: |