Mail Archives: djgpp/1994/11/24/01:15:59
On Thu, 24 Nov 1994, Peter K. Campbell wrote:
> This would merely be annoying, except for the fact that I can find
> nothing to automatically generate dependencies, which means it looks
> like I have to go through and add a useless:
> name.o: name.c
> line for every one of my source files.
>
For the name.o: name.c you can of course just use
.o.c :
gcc $(CFLAGS) -c $< -o $@
You can use the -M or -MM options to gcc, which generate dependency
files:
.PHONY: depend
depend :
gcc -MM *.c *.cc > makefile.dep
The difference between -M and -MM is that -MM does not include
the system header files (actually anything included with the <>
syntax) in the list of dependencies.
Gordon
- Raw text -