Hi,

the make.info suggests the following way of generating automatic 
dependencies:

     %.d: %.c
              $(CC) -M $(CPPFLAGS) $< > [EMAIL PROTECTED]; \
              sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < [EMAIL PROTECTED] > $@; \
              rm -f [EMAIL PROTECTED]

However, fairly recent GCC has the -MT option that allows to specify 
the targets to be put in the .d file. That is, one could just invoke 

  $ gcc -M -MT 'foo.o foo.d' foo.c

and get the dependencies in the form:

  foo.o foo.d: bar.h baz.h /usr/include/stdio.h

This avoids spawning 2 additional processes and making a temporary 
file. This option is available even in GCC 3.2; I haven't checked the 
releases before it. Why doesn't make suggest using it?

Regards,
Alexey.

-- 
Goodbye, Hunam, I hope you aren't eaten by monsters.
                        -- Spathi captain Fwiffo, SC2


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

Reply via email to