help-make
[Top][All Lists]
Advanced

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

Re: list of targets to make


From: Paul D. Smith
Subject: Re: list of targets to make
Date: Wed, 2 Nov 2005 19:18:23 -0500

%% Torsten Mohr <address@hidden> writes:

  tm> thanks for your hint.  It works, but can i also use $? in a
  tm> rule of the form:

  tm> $(OBJS_A) : %.o : %.c

Well, you of course CAN use it there, but this kind of rule won't do
what you want.

This rule tells how to build one .o from one .c, using one invocation of
the compiler.

If you want to build a bunch of .o's from a bunch of .c's, using a
single invocation of the compiler, then you have to write a rule that
expresses that: you can't have rules for each individual .o but rather
you must have a single rule for all of them.


The $? automatic variable, as you can read in the manual, expands to the
list of prerequisites that are newer than the target.  So, for a single
.o / single .c scenario, this isn't that useful, typically.

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