In bobbogo's answer to the Stack Overflow question How to write loop in makefile?, it is shown how to write the equivalent of the following pseudocode in a makefile:
For i in 1, ..., n:
Add the following rule "job_$i: ; ./a.out $i > output_$i"
The great thing about bobbogo's solution, as noted in the answer itself, is that the jobs will be run in parallel if you specify "-j num_threads". Other obvious, and simpler solutions, do not have this property.
My question: How can I do the same thing, but for a nested loop, i.e.:
For i in 1, ..., n:
For j in 1, ..., m:
Add the following rule "job_$i_$j: ; ./a.out $i $j > output_$i_$j"
I only anticipate using GNU Make. Thanks in advance!