From howardjp@wam.umd.edu Tue Aug 24 06:54:21 1999
Return-Path: <howardjp@wam.umd.edu>
Received: from po3.wam.umd.edu (po3.wam.umd.edu [128.8.10.165])
	by hub.freebsd.org (Postfix) with ESMTP id 76FE715138
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 24 Aug 1999 06:54:15 -0700 (PDT)
	(envelope-from howardjp@wam.umd.edu)
Received: from rac9.wam.umd.edu (root@rac9.wam.umd.edu [128.8.10.149])
	by po3.wam.umd.edu (8.9.3/8.9.3) with ESMTP id JAA21051
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 24 Aug 1999 09:53:58 -0400 (EDT)
Received: from rac9.wam.umd.edu (sendmail@localhost [127.0.0.1])
	by rac9.wam.umd.edu (8.9.3/8.9.3) with SMTP id JAA08648
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 24 Aug 1999 09:53:58 -0400 (EDT)
Received: (from howardjp@localhost)
	by rac9.wam.umd.edu (8.9.3/8.9.3) id JAA08644
	for FreeBSD-gnats-submit@freebsd.org; Tue, 24 Aug 1999 09:53:58 -0400 (EDT)
Message-Id: <199908241353.JAA08644@rac9.wam.umd.edu>
Date: Tue, 24 Aug 1999 09:53:58 -0400 (EDT)
From: James Howard <howardjp@wam.umd.edu>
Reply-To: howardjp@wam.umd.edu
To: FreeBSD-gnats-submit@freebsd.org
Subject: make clean in bsd.obj.mk no longer properly removes *.core and others
X-Send-Pr-Version: 3.2

>Number:         13350
>Category:       bin
>Synopsis:       make clean in bsd.obj.mk no longer properly removes *.core and others
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Aug 24 07:00:00 PDT 1999
>Closed-Date:    Fri Jul 20 18:23:49 PDT 2001
>Last-Modified:  Fri Jul 20 18:25:04 PDT 2001
>Originator:     James Howard
>Release:        FreeBSD 4.0-CURRENT i386
>Organization:
University of Maryland
>Environment:

FreeBSD bokonon.irving.org 4.0-CURRENT FreeBSD 4.0-CURRENT #0: Mon Aug 23 23:55:07 EDT 1999     irving@bokonon.irving.org:/usr/src/sys/compile/SANDERS  i386

>Description:

/usr/src/share/mk/bsd.README describes ``make clean'' as:

        clean:
                remove the program, any object files and the files a.out,
                Errs, errs, mklog, and ${PROG}.core.

However, make clean does not remove a.out, Errs, errs, mklog and
${PROG}.core any longer.  

>How-To-Repeat:

cd /usr/src/bin/cat (or anything else) and ``make clean''.  See what it
lists as files to delete.

>Fix:
	
Below is a diff which modifies /usr/src/share/mk/bsd.{prog,obj}.mk and
adds these files to CLEANFILES, the list of files which should be deleted.
I do not know if changes need to make to CLEANDIRS, I suspect not.  I
tested this are varius targets in /usr/src/bin and it worked every time.
Apply this diff to /usr/src/share/mk.  Thanks and have a nice day :)

diff -c mk/bsd.obj.mk mk-jph/bsd.obj.mk
*** mk/bsd.obj.mk	Tue Aug 24 00:10:30 1999
--- mk-jph/bsd.obj.mk	Tue Aug 24 00:14:23 1999
***************
*** 107,113 ****
  .if !target(clean)
  clean: _SUBDIR
  .if defined(CLEANFILES) && !empty(CLEANFILES)
! 	rm -f ${CLEANFILES} 
  .endif
  .if defined(CLEANDIRS) && !empty(CLEANDIRS)
  	rm -rf ${CLEANDIRS}
--- 107,113 ----
  .if !target(clean)
  clean: _SUBDIR
  .if defined(CLEANFILES) && !empty(CLEANFILES)
! 	rm -f a.out Errs errs mklog ${CLEANFILES} 
  .endif
  .if defined(CLEANDIRS) && !empty(CLEANDIRS)
  	rm -rf ${CLEANDIRS}
diff -c mk/bsd.prog.mk mk-jph/bsd.prog.mk
*** mk/bsd.prog.mk	Tue Aug 24 00:10:31 1999
--- mk-jph/bsd.prog.mk	Tue Aug 24 00:12:11 1999
***************
*** 67,73 ****
  .MAIN: all
  all: objwarn ${PROG} all-man _SUBDIR
  
! CLEANFILES+= ${PROG} ${OBJS}
  
  .if defined(PROG) && !defined(NOEXTRADEPEND)
  _EXTRADEPEND:
--- 67,73 ----
  .MAIN: all
  all: objwarn ${PROG} all-man _SUBDIR
  
! CLEANFILES+= ${PROG}.core ${PROG} ${OBJS}
  
  .if defined(PROG) && !defined(NOEXTRADEPEND)
  _EXTRADEPEND:

>Release-Note:
>Audit-Trail:

From: Bruce Evans <bde@zeta.org.au>
To: FreeBSD-gnats-submit@FreeBSD.ORG, howardjp@wam.umd.edu
Cc:  
Subject: Re: bin/13350: make clean in bsd.obj.mk no longer properly removes *.core and others
Date: Wed, 25 Aug 1999 03:41:13 +1000

 >/usr/src/share/mk/bsd.README describes ``make clean'' as:
 >
 >        clean:
 >                remove the program, any object files and the files a.out,
 >                Errs, errs, mklog, and ${PROG}.core.
 >
 >However, make clean does not remove a.out, Errs, errs, mklog and
 >${PROG}.core any longer.   
 
 This is intentional.  I forgot to change the README.  `make clean' is now
 supposed to remove precisely those files that are created automatically
 at some time (including temporaries).  ${PROG}.core will almost never
 be created, because ${PROG} is almost never run in the obj directory.
 If any cores are created, then they will be for things like cc1, but
 finding all cores is too hard, especially since we have a sysctl for
 changing the format of core file names.  a.out is only created in rare
 cases, mainly for libraries.  These cases are supposed to be handled
 specially.
 
 >>How-To-Repeat:
 >
 >cd /usr/src/bin/cat (or anything else) and ``make clean''.  See what it
 >lists as files to delete.
 
 `make -V CLEANFILES' should give the complete list.  (It doesn't for at
 least libraries.  Separate rm's are used for libraries to reduce the
 chance of there being too many args.)
 
 >diff -c mk/bsd.obj.mk mk-jph/bsd.obj.mk
 >*** mk/bsd.obj.mk	Tue Aug 24 00:10:30 1999
 >--- mk-jph/bsd.obj.mk	Tue Aug 24 00:14:23 1999
 >***************
 >*** 107,113 ****
 >  .if !target(clean)
 >  clean: _SUBDIR
 >  .if defined(CLEANFILES) && !empty(CLEANFILES)
 >! 	rm -f ${CLEANFILES} 
 >  .endif
 >  .if defined(CLEANDIRS) && !empty(CLEANDIRS)
 >  	rm -rf ${CLEANDIRS}
 >--- 107,113 ----
 >  .if !target(clean)
 >  clean: _SUBDIR
 >  .if defined(CLEANFILES) && !empty(CLEANFILES)
 >! 	rm -f a.out Errs errs mklog ${CLEANFILES} 
 >  .endif
 >  .if defined(CLEANDIRS) && !empty(CLEANDIRS)
 >  	rm -rf ${CLEANDIRS}
 
 This fails to remove a.out, etc. if CLEANFILES is unset or empty.  The
 main reason for not cleaning in all cases is to speed up `make clean'
 a bit.
 
 Bruce
 

From: James Howard <howardjp@wam.umd.edu>
To: Bruce Evans <bde@zeta.org.au>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: bin/13350: make clean in bsd.obj.mk no longer properly removes
 *.core and others
Date: Tue, 24 Aug 1999 14:04:58 -0400 (EDT)

 On Wed, 25 Aug 1999, Bruce Evans wrote:
 
 > This is intentional.  I forgot to change the README.  `make clean' is now
 
 Ahh, I see.  In that event, here is a diff to correct the README, not that
 it is that complicated, but anyway. 
 
 *** bsd.README.orig	Tue Aug 24 13:57:51 1999
 --- bsd.README	Tue Aug 24 13:58:43 1999
 ***************
 *** 158,165 ****
   	all:
   		build the program and its manual page
   	clean:
 ! 		remove the program, any object files and the files a.out,
 ! 		Errs, errs, mklog, and ${PROG}.core.
   	cleandir:
   		remove all of the files removed by the target clean, as
   		well as .depend, tags, and any manual pages.
 --- 158,164 ----
   	all:
   		build the program and its manual page
   	clean:
 ! 		remove the program and any object files.
   	cleandir:
   		remove all of the files removed by the target clean, as
   		well as .depend, tags, and any manual pages.
 
 

From: Bruce Evans <bde@zeta.org.au>
To: bde@zeta.org.au, howardjp@wam.umd.edu
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: bin/13350: make clean in bsd.obj.mk no longer properly removes *.core and others
Date: Wed, 25 Aug 1999 04:17:22 +1000

 >Ahh, I see.  In that event, here is a diff to correct the README, not that
 >it is that complicated, but anyway. 
 >
 >*** bsd.README.orig	Tue Aug 24 13:57:51 1999
 >--- bsd.README	Tue Aug 24 13:58:43 1999
 >***************
 >*** 158,165 ****
 >  	all:
 >  		build the program and its manual page
 >  	clean:
 >! 		remove the program, any object files and the files a.out,
 >! 		Errs, errs, mklog, and ${PROG}.core.
 >  	cleandir:
 >  		remove all of the files removed by the target clean, as
 >  		well as .depend, tags, and any manual pages.
 >--- 158,164 ----
 >  	all:
 >  		build the program and its manual page
 >  	clean:
 >! 		remove the program and any object files.
 
 It removes a bit more than object files.  This is perhaps best described
 by saying that it removes all generated files except the ones handled by
 cleadir.
 
 The README is seriously incomplete.  cleandepend is missing here.
 
 >  	cleandir:
 >  		remove all of the files removed by the target clean, as
 >  		well as .depend, tags, and any manual pages.
 
 This is quite out of date too.  cleandir also removes the canonical object
 directory and any link to it, modulo some complications when there is an
 obj subdirectory.
 
 Bruce
 
State-Changed-From-To: open->suspended 
State-Changed-By: mike 
State-Changed-When: Fri Jul 20 17:24:41 PDT 2001 
State-Changed-Why:  

This should be dead easy to fix, based on bde's comments.  Awaiting 
committer. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=13350 
State-Changed-From-To: suspended->closed 
State-Changed-By: mike 
State-Changed-When: Fri Jul 20 18:23:49 PDT 2001 
State-Changed-Why:  

Closed at the originator's request.  He believes the data in this 
PR is no longer accurate. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=13350 
>Unformatted:
