statcheck/makedepends
Simon Howard d0b751abd4 Generate dependencies
This ensures that the appropriate WAD files are extracted for each
demo.
2024-08-31 17:39:22 -04:00

25 lines
662 B
Python
Executable file

#!/usr/bin/env python3
from glob import glob
import os
import sys
from common import *
depends_file = sys.argv[1]
dependencies = {}
for filename in glob("expected/**/*.txt", recursive=True):
lmp_file = filename.replace("expected/", "demos/").replace(".txt", ".lmp")
cfg = read_config(lmp_file)
pwad = cfg.get("pwad")
if pwad is not None:
out_file = filename.replace("expected/", "output/")
dependencies[out_file] = [os.path.join("extract", pwad)]
with open(depends_file, "w") as f:
for out_file, depends in sorted(dependencies.items()):
f.write("%s: %s\n" % (
out_file, " ".join(depends),
))