On 2010-06-08 00:01Z, Alex Buell wrote:
> 
> %.d: %.c
>       $(CC) -MM $(CFLAGS) $< | $(SED) -e 's/$*.o/& $@/g' > $@
> 
> %.o: %.c
>       $(CC) $(CFLAGS) -c $^ -o $@

Use '$<' instead of '$^' in the '%.o: %.c' rule.

> gcc -ggdb3 -c vasm.c vasm.h -o vasm.o
> gcc: cannot specify -o with -c or -S with multiple files

$^ is 'vasm.c vasm.h'
$< is 'vasm.c'

> $ more vasm.d
> vasm.o vasm.d: vasm.c vasm.h
> 
> Hmm, it got both vasm.c and vasm.h, can't be right. Any ideas?

Both .c and .h files really should appear on the right-hand side of
the colon. If the .h files weren't there, then changing a header
wouldn't trigger recompilation.


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

Reply via email to