transform-dep.py: fake the -MP compiler option

This commit is contained in:
Jcw87 2023-01-26 21:30:17 -08:00
parent 8ccb2d4776
commit b63d35d9cf
1 changed files with 4 additions and 0 deletions

View File

@ -50,6 +50,7 @@ def import_d_file(in_file: str) -> str:
else:
out_lines.append(line.replace('\\', '/'))
headers: List[str] = []
for line in it:
suffix = ''
if line.endswith(' \\\n'):
@ -59,7 +60,10 @@ def import_d_file(in_file: str) -> str:
path = line.strip()
path = convert_path(path)
headers.append(path)
out_lines.append(f"\t{path}{suffix}\n")
# the metrowerks compiler doesn't support -MP
out_lines.extend([f'{header}:\n' for header in headers])
return ''.join(out_lines)