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: -MD and -MMD


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


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