This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Should we scrap -MG?
- To: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- Subject: Re: Should we scrap -MG?
- From: Geoff Keating <geoffk at geoffk dot org>
- Date: 04 Mar 2001 14:01:02 -0800
- CC: gcc at gcc dot gnu dot org
- References: <20010304160408.G15572@daikokuya.demon.co.uk>
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>