I'd still like to use the $(shell ...) stuff and define a variable, but only if the target t1 is executed. Is there any trick to achieve that?

ohh, i guess = instead of := does the trick, although the shell-command will be executed many times if the variable is used many times.

It seems clearly documented to me, but here's an example anyway:


[exmaple]

what about the $(shell ..) stuff i used in my example?
of course target-specific variables work like in you example, but although not needed,
t1: TEST:=$(shell find)
would cause find to be executed no matter which make-target i run.
That's the point i want to avoid. I only want the shell-command to be run once and only if a specific make-target is run.


TEST=$(shell find) is a workaround in my case, since i use $(TEST) only once, but if i would use it multiple times, the shell-command would also be executed multiple times. That's again something, that i don't want. The shell-command should be executed only once.



_______________________________________________
Help-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-make

Reply via email to