Subject: Re: auto creation od .depend files
To: David Laight <david@l8s.co.uk>
From: Simon J. Gerraty <sjg@crufty.net>
List: tech-toolchain
Date: 01/30/2004 22:42:01
On Thu, 29 Jan 2004 22:28:57 +0000, David Laight writes:
>> Its not actually that big a deal if you do it always.
>> At least I've not found it to be a problem.
>
>Well 'make depend' only rebuild them if the .c file has changed.
>This causes grief quite often.
>Also the 'make depend' pass takes a moderate amount of HP.

Sure, but I _never_ do 'make depend' at least not in 3 years.
So the overhead is simple the sed command to coalless the .d's into
.depend (at least that's what autodep.mk does).

>> Have you looked at the autodep.mk I've mentioned a couple of times?
>> Its been in constant use for over 3 years (in a pretty busy engineering dept
>.)
>> and even without use of .OPTIONAL has worked very well.  
>> You can find it in pkgsrc/devel/mk-files
>
>maybe I ought to....

Hang on - apparently I let a freebsd'sm sneak into the copy in the
current mk-files ;-) need to fix that ;-)

>> >This is done by detecting whether ${CPPFLAGS) has been expanded by setting:
>> >SKIP_AUTODEP=\#
>> >CPPFLAGS+=${SKIP_AUTODEP::=}
>> 
>> This is cute - I like it.  
>> Note that SKIP_AUTODEP=: would work as well, and save you
>> the need to quote things.
>
>Would it? you the assignment to SKIP_AUTODEP to happen whan a command line
>is executed, not when the makefile is parsed.

Sorry I meant:

SKIP_AUTODEP= :
CPPFLAGS+=${SKIP_AUTODEP::=}

>I've been bitten too often (as have people less savvy) by make reporting:
>'don't know how to make xyz.h'
>during an update build, and deciding that the only fix is to delete the
>entire $OBJ tree.

My question was, is it worth all the effort (of fiddling CPPFLAGS) to
avoid a blind (and hence simple) sed ... *.d > .depend after a
successful compilation?

Thanks
--sjg