Subject: misc/9618: make depend fails to run mkdep sometimes.
To: None <gnats-bugs@gnats.netbsd.org>
From: None <erh@nimenees.com>
List: netbsd-bugs
Date: 03/14/2000 13:33:46
>Number:         9618
>Category:       misc
>Synopsis:       make depend fails to run mkdep sometimes.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    misc-bug-people (Misc Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Mar 14 13:33:00 2000
>Last-Modified:
>Originator:     Eric Haszlakiewicz
>Organization:
>Release:        NetBSD-current 20000313
>Environment:
System: NetBSD realms.nimenees.com 1.4T NetBSD 1.4T (REALMS) #0: Mon Feb 21 13:01:03 CST 2000 root@realms.nimenees.com:/usr/build/REALMS i386


>Description:
	Running a make depend isn't always enough to ensure that dependancies
get updated.  It is only correct in the case where included files don't
include another file themselves.  Since only the modification dates of
the .depend file and the original source file (the one on which mkdep is run)
are compared a change in an included file will not be noticed.
>How-To-Repeat:
File foo.c:
	#include "bar.h"

File bar.h:
	#include "bar2.h"

File bar2.h:
	... whatever ...

File bar3.h:
	... whatever ...

File Makefile:
	SRCS=foo.c
	.include <bsd.prog.mk>

run make depend.  Notice that .depend contains correct dependencies
	(bar.h and bar2.h)
edit bar.h and add #include "bar3.h"
run make depend.  Notice that mkdep isn't run and .depend is incorrect.
(This is more of a problem if an included file is removed but still
exists in .depend since an error will occur when trying to build)

>Fix:
	workaround: remove all .depend files before running make depend.
	fix: cause make to check modification times on all files in
		the dependancy list.  this seems like it would slow
		things down a lot.
>Audit-Trail:
>Unformatted: