bug-make
[Top][All Lists]
Advanced

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

Re: Target-specific variables and built-in rules


From: Paul D. Smith
Subject: Re: Target-specific variables and built-in rules
Date: Mon, 11 Mar 2002 13:49:39 -0500

%% Bradford Castalia <address@hidden> writes:

  bc> In the "Target-specific Variable Values" section of the gmake manual 
(http://www.gnu.org/manual/make-3.79.1/html_node/make_70.html#SEC69)
  bc> it is noted that " when you define a target-specific variable, that
  bc> variable value is also in effect for all prerequisites of this target".

Yes.

  bc> However, this does not work for built-in rules, as is demonstrated by
  bc> the following example:

No; you are greatly misinterpreting the results you're seeing :).

  bc> # Example Makefile
  bc> try: OBJECT = try.o
  bc> try:      $(OBJECT)

This won't work.  You cannot use target-specific variables in the
prerequisites list, they are _ONLY_ available within the command script
(just like automatic variables).  From the manual, section
_Target-Specific Variable Values_:

  As with automatic variables, these values are only available within
  the context of a target's command script (and in other target-specific
  assignments).

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://www.paulandlesley.org/gmake/
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist



reply via email to

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