Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Feb 2004 02:42:07 -0500
From:      Garance A Drosihn <drosih@rpi.edu>
To:        hackers@FreeBSD.org
Cc:        ru@FreeBSD.org
Subject:   Adding 'realclean' target to /usr/src/Makefile
Message-ID:  <p0602040fbc54cd0d3342@[128.113.24.47]>

next in thread | raw e-mail | index | archive | help
In the instructions I am writing up for a sparc64 change, I wrote
that people should:
     rm -Rf /usr/obj/usr/src/*

to make sure they got rid of everything in the previous buildworld.
Some developers reminded me that this isn't always the right thing
to do (depending on symlinks or on various settings the user may
have set).  Some suggested 'rm /usr/obj/*', but I do not like that
because I have other things in /usr/obj that I don't want to blow
away.  And besides, even that can be wrong if the user has set
something like MAKEOBJDIRPREFIX.

It occurs to me that the simple, reliable solution to this is to
add a 'realclean' target to /usr/src/Makefile, such as:

realclean :
	rm -Rf ${.OBJDIR}/*

Another option is to put that into /usr/src/Makefile as the
'cleandir' target.  Right now that 'cleandir' target goes to the
extra work of looping through all subdirectories, and having
*those* Makefiles do whatever they want for a 'cleandir' target.
This includes printing out all kinds of status messages, and
frankly seems like a waste of time to me.  I'd rather type in the
'rm' command by hand then wait for that target, but I expect that
behavior serves a purpose, so I'm suggesting the new target.

Seeing that this is in /usr/src/Makefile, and that it's a simple
two-line change, I'm sure there's at least a hundred developers
who will have strong opinions about it.  So, should I do it, or
will I be beaten around the head and shoulders for suggesting it?

-- 
Garance Alistair Drosehn            =   gad@gilead.netel.rpi.edu
Senior Systems Programmer           or  gad@freebsd.org
Rensselaer Polytechnic Institute    or  drosih@rpi.edu



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?p0602040fbc54cd0d3342>