Reputation: 2504
Assume I have a code producing output depending on a single input variable, which I want to run for a range of input values. Following what is proposed here, I can do this with a makefile as follows:
out1 out2 out3: out%: a.out
./a.out $* > $@
Can this be generalized to more than one parameter? I.e. something like
out1_1 out1_2 out2_1 out2_2: out%_%: a.out
./a.out $*{1} $*{2} > $@
The $*{i}
should refer to what the i
th %
matched.
Upvotes: 0
Views: 250
Reputation: 80941
No, make only supports a single %
in a target/prerequisite pattern.
To do what you want you would need to stem the entire #_#
bit and then munge/parse that in shell.
Upvotes: 1