On 2006-4-6 12:18 UTC, Paul D. Smith wrote:
> %% Greg Chicares <[EMAIL PROTECTED]> writes:
> 
>   >> $(PROG): $(SRC)
>   >>        gcc -c $?
>   >>        gcc -o $@ $(^:.c=.o)
> 
>   gc> I think that does more work than is needed.
>   gc> That would execute
> 
>   gc>   gcc -c a.c b.c c.c
> 
> Nope.  Check out the definition of the $? automatic variable in the GNU
> make manual.

If all but one of the source files have been compiled,
but $(PROG) doesn't exist, then all source files will
be recompiled--even though only one needs to be. That's
consistent with the manual's $? definition:
| The names of all the prerequisites that are newer
| than the target...
because any file that exists is "newer" than a target
that doesn't. It's the behavior I observe when running
the testcase I gave, with both 3.79.1 and 3.81 .


_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to