This is the mail archive of the gcc@gcc.gnu.org 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: Should we scrap -MG?


Neil Booth <neil@daikokuya.demon.co.uk> writes:

> Does anyone know of any good use of this option, which prints
> dependencies on missing header files.
> 
> I see at least two problems with this:-
> 
> o We don't know if the header file really should exist or not (!?)
> o We don't know in which directory it should exist
> o We don't know if the absent header includes other headers.
> 
> Basically, I see little point in being able to generate dependencies
> for something we cannot preprocess, let alone compile, and "handling"
> this considerably obfuscates some of cpplib.
> 
> This came up in a private discussion with Zack; I then asked Tom Tromey
> if he knew of any sane use of it and he couldn't think of one either.

It's intended for use when some header files are generated.  make
won't know what header files to generate unless there's some way to
list the header files that don't exist but are required.

The third problem you list is dealt with by re-running dependencies
after the header is generated, typically by making the dependency part
of the makefile depend on the missing header.

The second problem is dealt with by putting all generated headers in
the same place.

-- 
- Geoffrey Keating <geoffk@geoffk.org>


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