0

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 ith % matched.

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.