Subject: misc/31934: toplevel cleandir doesn't honor MKX11=yes
To: None <misc-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <dholland@eecs.harvard.edu>
List: netbsd-bugs
Date: 10/28/2005 05:11:00
>Number:         31934
>Category:       misc
>Synopsis:       toplevel cleandir doesn't honor MKX11=yes
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    misc-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Oct 28 05:11:00 +0000 2005
>Originator:     David A. Holland <dholland@eecs.harvard.edu>
>Release:        NetBSD 3.99.10 (-20051026)
>Organization:
   Harvard EECS
>Environment:
System: NetBSD tanaqui 3.99.10 NetBSD 3.99.10 (TANAQUI) #3: Wed Oct 26 18:52:27 EDT 2005 root@tanaqui:/usr/src/sys/arch/i386/compile/TANAQUI i386
Architecture: i386
Machine: i386
>Description:
	Today for the heck of it I did a 'make cleandir' from /usr/src,
	(instead of the simpler rm -rf /usr/obj) and noticed that it doesn't
	clean out /usr/obj/x11, even though I have MKX11=yes set in mk.conf.

	This presumably also applies to the other toplevel targets.

>How-To-Repeat:
	set MKX11=yes, make cleandir

>Fix:
	The simple solution would be to put

	.if ${MKX11} != "no"
	SUBDIR+=x11
	.endif

	at some suitable place in the toplevel makefile, probably
	right after the rest of the setting of SUBDIR.

	However, this by itself would cause the build to go through
	src/x11 twice. The special entry for x11 in BUILDTARGETS needs
	to be removed to correspond.

	I'm not sure if this is actually a good idea. It seems like it
	might be opening a can of worms, at least in the short term.

	The alternative (adding extra special-case hacks for the clean
	and cleandir targets) is almost certainly a bad idea, so if it
	comes to that, kill the PR. :-)