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]
Other format: [Raw text]

Re: request for timings - makedepend


>>>>> "DJ" == DJ Delorie <dj@redhat.com> writes:

>> probably the sanest thing is to go with the automake-like approach of
>> one .d file per .c file, which then can be annotated without having to
>> write logic to parse a big dependency file and update it in place.

DJ> The problem with .d files is that there's no good automatic way to
DJ> deal with headers that get renamed or deleted; the dependency on the
DJ> old file is listed but there's no way to make that file.

The automake approach is to emit a dummy target for each header.
This avoids the deleted header file problem.

Automake also doesn't do a separate "make depend" step.  Dependencies
are computed as a side effect of compilation.  There is a wrapper
script that handles most kinds of compilers (with a fallback to an
old-style makedepend), but if you are building with gcc this is
bypassed in favor of a fast track in the Makefile.

Computed headers are dealt with somewhat clumsily in automake.  As a
user you specify "BUILT_SOURCES", and then these are built by 'all'
before anything else is done.  Ordinary dependencies do suffice here,
they just aren't the style automake users are encouraged to use; in
gcc you could just tack them on to the end of a "%.o: %.c" rule.

Tom


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