I am producing artifacts foo.out
, bar.out
, and qux.out
. I have a rule %.cooked: %.raw
.
- For all files
foo-★.raw
, I needfoo.out
to depend onfoo-★.cooked
- Likewise for
bar
andqux
Currently, I am not restricting the raw
files that are being built, so make bar.out
is wastefully cooking dozens of foo-1.raw
, foo-2a.raw
, foo-2b.raw
, etc. which is really eating into my time.
I tried using secondary expansion:
<code>.SECONDEXPANSION:
$(OUTFILES): %.out: $$(patsubst %.raw,%.cooked,$$(wildcard $$%-*.raw))
build $< --output $@
</code>
<code>.SECONDEXPANSION:
$(OUTFILES): %.out: $$(patsubst %.raw,%.cooked,$$(wildcard $$%-*.raw))
build $< --output $@
</code>
.SECONDEXPANSION:
$(OUTFILES): %.out: $$(patsubst %.raw,%.cooked,$$(wildcard $$%-*.raw))
build $< --output $@
but it seems that this ended up being empty and nothing was built.