Subject: port-m68k/6244: Unexpected behaviour of "make cleandir" in kernel build dir
To: None <gnats-bugs@gnats.netbsd.org>
From: Frederick Bruckman <fb@enteract.com>
List: netbsd-bugs
Date: 10/04/1998 15:39:03
>Number:         6244
>Category:       port-m68k
>Synopsis:       "make cleandir" in kernel build directory fails to remove fpsp objects.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sun Oct  4 13:50:01 1998
>Last-Modified:
>Originator:     Frederick Bruckman
>Organization:

>Release:        October 4, 1998
>Environment:
	
System: NetBSD fb.sa.enteract.com 1.3G NetBSD 1.3G (FB) #96: Sun Aug 30 11:30:21 CDT 1998
fredb@fb.sa.enteract.com:/usr/src/sys/arch/mac68k/compile/FB mac68k


>Description:
	The expectation, is that "make cleandir" or "make distclean", if they do
	anything at all, will remove at least as many targets as "make clean" does.
	This expectation is not borne out in the kernel build
	directory--specifically, the lib/fpsp directory is left untouched!
	Investigation reveals that the "cleandir" target is commented out of
	sys/arch/m68k/fpsp/Makefile.inc, which is perhaps related to the fact
	that the "depends" target is also commented out. That would all be
	reasonable in a top-level directory, but in this case it produces the
	following unexpected result. 
>How-To-Repeat:
	Configure and build a kernel with "options FPSP". That option is
	suitable for a 68040. Now type "make cleandir" in the build
	directory. Notice that all the targets are cleaned out of the main
	directory, also the lib/kern and lib/compat directories, but that all
	the objects remain in the lib/fpsp directory. "make clean" _does_ clean
	the objects out of the fpsp directory, but of course it leaves the
	.depend files in the first three directories. There's actually very
	little consequence, if any, to not cleaning out the fpsp directory. 
	It's just odd, that's all.
>Fix:
--- src/sys/arch/m68k/fpsp/Makefile.inc.orig    Sun Oct  4 12:20:14 1998
+++ src/sys/arch/m68k/fpsp/Makefile.inc Sun Oct  4 12:23:42 1998
@@ -47,10 +47,14 @@
@echo cleaning the 68040 FPSP objects
@${FPSPMAKE} clean
 
-#cleandir distclean:   .NOTMAIN cleandirfpsp
-#cleandirfpsp: .NOTMAIN __always_make_fpsp
-#      @echo cleandiring the 68040 FPSP objects
-#      @${FPSPMAKE} cleandir
+cleandir distclean:    .NOTMAIN cleandirfpsp
+cleandirfpsp:  .NOTMAIN __always_make_fpsp
+# So we don't really need a cleandir target without a depend target.
+# On the other hand, were "make cleandir" in the kernel build
+# directory to fail to remove all the floating point objects, that
+# would tend to violate the principle of least surprise!
+       @echo cleaning the 68040 FPSP objects
+       @${FPSPMAKE} clean
 
#depend:                       .NOTMAIN dependfpsp
#dependfpsp:           .NOTMAIN __always_make_fpsp

>Audit-Trail:
>Unformatted: