This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: -MD and -MMD
- To: Tom Tromey <tromey at redhat dot com>
- Subject: Re: -MD and -MMD
- From: Jamie Lokier <egcs at tantalophile dot demon dot co dot uk>
- Date: Sun, 14 Jan 2001 22:43:48 +0100
- Cc: gcc at gcc dot gnu dot org
- References: <87u276f2bj.fsf@creche.redhat.com>
Tom Tromey wrote:
> I've noticed that neither -MD nor -MMD is documented in invoke.texi.
> Is this intentional? I'm worried that this lack of documentation
> might mean that these switches are deprecated. If that's the case,
> I'd like to argue against deprecating them.
SUNPRO_DEPENDENCIES isn't documented either and it's been a feature for
years. I find it most surprising that it's not documented, as I find it
the single most useful feature for automatic dependencies in embedded
work. (DEPENDENCIES_OUTPUT is appropriate for non-embedded work and
it's documented).
Like this:
.c.o:
> .dep-$@; DEPENDENCIES_OUTPUT='.dep-$@ $@' \
$(CC) $(CFLAGS) -c $< -o $@
%.h:
@echo 'Let'\''s pretend the file `$@'\'' still exists...'
__DEP_FILES := $(wildcard .dep-*)
ifneq "" "$(__DEP_FILES)"
-include $(__DEP_FILES)
endif
These various -M options are all very handy I'm sure, but for simple
_automatic_ dependencies I find the above much more effective.
I've used this for 6 years on many projects, and I still don't see why
other projects need "make depend".
-- Jamie