On 12-Feb-2001, Thomas Chen <[EMAIL PROTECTED]> wrote:
> I don't know how to write a single rule for all of them. What I can do
> is:
>
> LIST = a b c
>
> ${LIST} : %_1 : %
> echo "$* 1"
> ${LIST} : %_2 : %
> echo "$* 2"
>
> Is there any way to put them together? There are also "d,e,f .." and
> "3, 4, 5 ..." in my real situation.
You can generate the Makefile rules automatically:
LIST1 = a b c d
LIST2 = 1 2 3 4
Rules : Makefile
for x in $(LIST2); do \
echo "$(LIST1:%=%_$$x) : %_$$x : %"; \
echo ' echo $$* "'"$$x"'"'; \
done > Rules
include Rules
You might also want a target for creating everything:
ALL := $(shell for x in $(LIST1); do for y in $(LIST2); do \
echo $${x}_$${y}; done; done)
all : $(ALL)
And your original Makefile didn't specify how to create `a', `b', etc.,
so you may want to fill in some rules for them:
$(LIST1) : ...
...
--
Fergus Henderson <[EMAIL PROTECTED]> | "I have always known that the pursuit
| of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.
_______________________________________________
Help-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-make