This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: -MD behavior does not match documentation
- To: gcc at egcs dot cygnus dot com
- Subject: Re: -MD behavior does not match documentation
- From: Tom Tromey <tromey at cygnus dot com>
- Date: 16 Sep 1999 18:16:49 -0600
- Newsgroups: cygnus.egcs
- Organization: Cygnus Solutions
- References: <37E0FDB5.F0BE4059@sls.lcs.mit.edu> <19990916225821.E20920@pcep-jamie.cern.ch>
- Reply-To: tromey at cygnus dot com
Jamie> This is why I use the SUNPRO_DEPENDENCIES environment variable.
Jamie> Sadly It's not documented, but it's the only way to get
Jamie> dependencies to do the right thing when the -o name is
Jamie> different to the source name. For example, when compiling one
Jamie> source file to multiple target objects, with different -D
Jamie> settings. DEPENDENCIES_OUTPUT doesn't work for this.
I'd eventually like to change the dependency generation "UI".
Automake in particular wants a few things not provided by gcc:
* It wants to pick the name of the resulting dependency file. I
propose a new "-MF FILE" option to do this.
* It wants to pick the name of the target put into the dependency
file. I propose a new "-MT STRING" option. (Sometimes having gcc
guess the answer can't be right: for instance when automake is
generating libtool objects, we want both the ".o" and the ".lo" forms
to be named.)
* It wants to have gcc generate a phony target for each header
mentioned in the result. E.g., if gcc generates "foo.o: foo.h", it
should also add "foo.h:" to the file. This is a fix for the "deleted
header file" problem that plagues most automatic dependency tracking
schemes. I propose a new "-MA" (A for "Automake" -- no imagination
here) option.
Right now automake goes through some rather ugly gyrations
("-Wp,-MD,..." followed by hairy sed invocations) to get what it
wants. The other solutions are, for various reasons, not acceptable.
I don't recall why SUNPRO_DEPENDENCIES isn't acceptable. Perhaps it
doesn't let me pick the output file's name. Or perhaps, like the
DEPENDENCIES_OUTPUT macro, it acts like -MM and not -M.
I'd also like all the front ends to agree to work the same way in this
area.
I've been meaning to do this for a long time, but I rarely have
hacking time that isn't already allocated. Bummer.
Tom