From rwsys!sneaky.lonestar.org!gordon@lerami.lerctr.org  Fri Aug 11 18:48:38 1995
Received: from news.onramp.net (news.onramp.net [199.1.11.7])
          by freefall.FreeBSD.org (8.6.11/8.6.6) with ESMTP id SAA05560
          for <FreeBSD-gnats-submit@freebsd.org>; Fri, 11 Aug 1995 18:48:37 -0700
Received: from rwsys!sneaky.lonestar.org (uucp@localhost) 
	by news.onramp.net (8.6.12/8.6.9) with UUCP id UAA05793 for FreeBSD-gnats-submit@freebsd.org; Fri, 11 Aug 1995 20:48:35 -0500
Received: by lerami.lerctr.org (/\oo/\ Smail3.1.29.1 #29.2)
	id <m0sh5Zg-0000g6C@lerami.lerctr.org>; Fri, 11 Aug 95 20:41 CDT
Received: by rwsys.lonestar.org (Smail3.1.27.1 #1)
	id m0sh54Y-00007mC; Fri, 11 Aug 95 20:09 CDT
Received: by hammy.lonestar.org (Smail3.1.29.1 #1)
	id m0sh3Bs-0001hRC; Fri, 11 Aug 95 18:08 CDT
Message-Id: <m0sh3Bs-0001hRC@hammy.lonestar.org>
Date: Fri, 11 Aug 95 18:08 CDT
From: gordon@sneaky.lonestar.org
Reply-To: gordon@sneaky.lonestar.org
To: FreeBSD-gnats-submit@freebsd.org
Subject: make does unnecessary rebuilds starting with FreeBSD 2.0R
X-Send-Pr-Version: 3.2

>Number:         675
>Category:       bin
>Synopsis:       make does unnecessary rebuilds
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    steve
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Aug 11 18:50:01 PDT 1995
>Closed-Date:    Mon Sep 30 20:38:54 PDT 1996
>Last-Modified:  Mon Sep 30 20:41:14 PDT 1996
>Originator:     Gordon Burditt
>Release:        FreeBSD 2.0-BUILT-19950603 i386
>Organization:
what organization? 
>Environment:

	FreeBSD 2.0.5R


>Description:

	When make encounters a rule that may or may not update the
	target, it considers the target modified whether it actually
	is or not, and forces recompiles of everything that depends
	on that target.  This behavior is new starting with 2.0;
	1.1R and 1.1.5.1R forced recompiles of everything that depends
	on that target only if it was actually modified.

	The makefile attached below builds a program, and the only
	thing unusual about it is the use of cproto to automatically
	build a prototype file included by all source files.  The
	header file is only modified if the prototypes actually
	change.  Recompilation of everything is needed only if
	proto.h is touched.

	Is there any way to get the behavior I want?


>How-To-Repeat:

	Create an empty directory (preferably on a non-NFS filesystem)
	with the attached Makefile, a.c, b.c, and c.c files in it.  
	Do a make, which will build the program.  Touch c.c.  Do 
	another make.  Recompiling c.c is necessary, but recompiling 
	a.c and b.c is not.  2.0R and 2.0.5R make recompile everything;
	1.1R and 1.1.5.1R recompile only c.c.

Makefile:
_______________________________
all:	prog

prog:	a.o b.o c.o
	$(CC) -o prog a.o b.o c.o

proto.h:	proto.tmp
	-if cmp proto.tmp proto.h; then : ; else cp proto.tmp proto.h; fi

proto.tmp:	a.c b.c c.c
	cproto a.c b.c c.c > proto.tmp

# This would normally go in .depend
a.o:	proto.h a.c
b.o:	proto.h b.c
c.o:	proto.h c.c
_______________________________
a.c:
_______________________________
# include "proto.h"
void a(void) { puts("hello"); }
_______________________________
b.c:
_______________________________
# include "proto.h"
void b(void) { puts("world"); }
_______________________________
c.c:
_______________________________
# include "proto.h"
int main(void) { a(); b(); return 0; }
_______________________________

Note:  if you don't have cproto, for the purpose of this test you
can replace it with "grep frobnicate".

Comments in the make source near "RECHECK" in compat.c and make.c
discuss this problem.  The obvious fix is to define RECHECK.
The trouble is, RECHECK already IS defined and it still doesn't work.

>Fix:
	
	

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->rgrimes 
Responsible-Changed-By: scrappy 
Responsible-Changed-When: Sun May 26 22:27:09 PDT 1996 
Responsible-Changed-Why:  
for lack of anyone recent...sorry rod :( 
Responsible-Changed-From-To: rgrimes->freebsd-bugs 
Responsible-Changed-By: scrappy 
Responsible-Changed-When: Mon May 27 10:38:50 PDT 1996 
Responsible-Changed-Why:  
*sigh* sorry rod... 
State-Changed-From-To: open->closed 
State-Changed-By: steve 
State-Changed-When: Mon Sep 30 20:38:54 PDT 1996 
State-Changed-Why:  
Fixed in -current. 
>Unformatted:
