|
From: | Sven Köhler |
Subject: | Re: target-specific variables |
Date: | Sun, 14 Mar 2004 16:17:00 +0100 |
User-agent: | Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113 |
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.
[Prev in Thread] | Current Thread | [Next in Thread] |