On 10.12.2010 0:31, David Boyce wrote:
On Thu, Dec 9, 2010 at 6:26 AM, AdamWainwright<[email protected]> wrote:
-------------------------------------------------
PROGS=../xxx
$(PROGS): $(addsuffix .y, $(@F))
cp $(@F).y $@
-------------------------------------------------
Initial run copies file 'xxx.y' to 'xxx'. If 'xxx.y' is updated then the
rule does not equate to 'true' (because the file 'xxx' doesn't exist) and
actions taken. Using debug I find it isn't even considering the
dependencies of the addsuffix() and states that the file doesn't need to be
updated. I feel there is some error in my logic here but I can't put my
finger on it.
One error in your logic is documented at
http://www.gnu.org/software/make/manual/make.html#Automatic-Variables:
"It's very important that you recognize the limited scope in which
automatic variable values are available: they only have values within
the recipe." Since $@ and its variant $(@F) are automatic variables,
they cannot be used in the top (target: prereq) line.
And also you can see doc about .SECONDEXPANSION.
But stop!
How about "Pattern Rules"?
../%: %.y
cp ...
or if PROGS count is few (you mention only one) write:
../prog1: prog1.y
cp ...
../prog2: prog2.y
cp ...
--
С уважением, Александр Гавенко.
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make