Subject: Re: make and .OPTIONAL
To: David Laight <david@l8s.co.uk>
From: Luke Mewburn <lukem@NetBSD.org>
List: tech-toolchain
Date: 11/08/2003 16:03:03
On Fri, Nov 07, 2003 at 07:19:35PM +0000, David Laight wrote:
  | I thought I'd try to stop the build failing when a .depend file
  | references an old .h file by changing mkdep so that it adds:
  | 
  | .OPTIONAL: header.h .....
  | 
  | This stops the build failing, but the program that depended on the
  | deleted .h file is always rebuilt.

I'm not convinced that this is necessary.  I'll defer to the make(1)
gurus (sjg@, etc :) if they disagree.


I was considering that an extra option to mkdep(1) to "validate .depend"
(and return non-zero if files missing, but don't necessarily rebuild)
and use that for this purpose.  That would be quicker than doing the
check in bsd.dep.mk with sed/make .for loop.