Add make wads target.

Used by wadptr's continuous integration.
This commit is contained in:
Simon Howard 2024-09-16 18:12:38 -04:00
parent 5b67efbb05
commit e019fe8762

View file

@ -42,14 +42,17 @@ class Rule:
.replace(".txt", ".lmp")) .replace(".txt", ".lmp"))
self.cfg = read_config(self.lmp_file) self.cfg = read_config(self.lmp_file)
def dependencies(self): def wads(self):
yield self.lmp_file yield join("extract", self.cfg["iwad"])
yield "$(SOURCE_PORT)"
yield join("iwads", self.cfg["iwad"])
pwad = self.cfg.get("pwad") pwad = self.cfg.get("pwad")
if pwad is not None: if pwad is not None:
yield join("extract", pwad) yield join("extract", pwad)
def dependencies(self):
yield self.lmp_file
yield "$(SOURCE_PORT)"
yield from self.wads()
deh = self.cfg.get("deh") deh = self.cfg.get("deh")
if deh is not None: if deh is not None:
yield join("extract", deh) yield join("extract", deh)
@ -91,8 +94,12 @@ class Rule:
depends_file = sys.argv[1] depends_file = sys.argv[1]
rules = [] rules = []
all_wads = set()
with open(depends_file, "w") as f: with open(depends_file, "w") as f:
for filename in sorted(glob("expected/**/*.txt", recursive=True)): for filename in sorted(glob("expected/**/*.txt", recursive=True)):
r = Rule(filename) r = Rule(filename)
f.write(r.rule_output()) f.write(r.rule_output())
all_wads = all_wads | set(r.wads())
f.write("wads: %s\n" % shlex.join(all_wads))