This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: -MD behavior does not match documentation

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

I've been meaning to do this for a long time, but I rarely have
hacking time that isn't already allocated.  Bummer.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]