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.