%% 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.
Using the $? variable is definitely what the OP wants. That's what it's
there for.
Another option (untested) that might be a tiny bit faster (but maybe not
enough to matter):
$(PROG): $(SRC)
gcc -o $@ $? $(patsubst %.c,%.o,$(filter-out $?,$^))
--
-------------------------------------------------------------------------------
Paul D. Smith <[EMAIL PROTECTED]> 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
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make