bug-make
[Top][All Lists]
Advanced

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

Re: Question about GNU Make


From: Paul D. Smith
Subject: Re: Question about GNU Make
Date: Mon, 21 May 2001 10:28:42 -0400

%% "Margalit, Sivan" <address@hidden> writes:

  ms> I have a problem to define variable assignment per target.

With any question, request for help, or bug report, please always
include the version of GNU make you're using and the operating system
(and version) you're using it on.

This actually goes for any program, not just GNU make.

  ms> Requirements:
  ms>   all_targets = target1 target2 
  ms>   for target1 set variable a = val1 
  ms>             for target2 set variable a = val2
  ms>   all_target:
  ms>           call $@ a .....

  ms> In make manual chapter "Target-specific Variable values" I found:

  ms> There is one more special feature of target-specific variables:
  ms> when you define a target-specific variable, that variable value is
  ms> also in effect for all prerequisites of this target

  ms> I think This is what I need.

It doesn't sound like it to me based on your pseudo-code above, but...

  ms> But When I tried to implement it I got an error message " no rule
  ms> for CFLAGS needed for target prog"

Sounds to me like you are using an older version of GNU make that
doesn't support this syntax.  This feature was added in GNU make 3.77,
but you should use the latest version as there have been a few bug fixes
since then.

If you are using a version of GNU make 3.77 or newer, please reproduce
the problem with the smallest makefile you can and include the exact
makefile text, along with what exactly what make printed and why that
wasn't what you expected.  Cut and paste into the email is best.

Thanks!

-- 
-------------------------------------------------------------------------------
 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]