[Top][All Lists]

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

RE: TR: Adresses email sur les probl?mes gmake

From: Paul D. Smith
Subject: RE: TR: Adresses email sur les probl?mes gmake
Date: Mon, 12 Jan 2004 10:47:11 -0500

%% "Massonnier Laurent" <address@hidden> writes:

  ml> Thank you, for your quickness and accuracy.  I've understood I
  ml> can't use these kind of variables to accurately define my
  ml> prerequisites. Ok.

  ml> But, please, have you got an idea about how I could change my
  ml> makefile so as to dynamically load the prerequisites of a target
  ml> from another file, (whose name depends on the target name) ? Not
  ml> speaking about writing the makefile, but about the best mechanics
  ml> to do it ?

There are two ways.

First, you can use include files.  If you include a file that contains
the prerequisites, and create a rule so make knows how to build that
file, then make will rebuild it whenever it's out of date then
automatically re-exec itself to read in the new file.  You can see an
example of this method in the GNU make manual, section "Generating
Prerequisites Automatically".

Second, if you're willing to require GNU make 3.80 or above you can use
the $(eval ...) function to generate prerequisites.

Finally, if what you're trying to do is keep .h etc. files up to date,
you should look at my web site below, which describes an advanced method
used by automake (but you can use it without automake) that might be
better for this specific job than either of the above.

 Paul D. Smith <address@hidden>          Find some GNU make tips at:            
 "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]