help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Odd rule issue


From: David Boyce
Subject: Re: Odd rule issue
Date: Thu, 9 Dec 2010 17:31:27 -0500

On Thu, Dec 9, 2010 at 6:26 AM, AdamWainwright <address@hidden> 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.

David Boyce



reply via email to

[Prev in Thread] Current Thread [Next in Thread]