7 Sep 2011 23:51
Changing "make clean" and "make cleandir"
Alan Barrett <apb <at> cequrux.com>
2011-09-07 21:51:27 GMT
2011-09-07 21:51:27 GMT
I would like to make "make clean" and "make cleandir" delete
leftover files in the source directory as well as the obj
directory. This should help with the case that the current build
uses .OBJDIR != .CURDIR, but an earlier build with .OBJDIR =
.CURDIR had left some output files in the source directory.
The appended patch makes the following changes to how "make clean"
and "make cleandir" work:
* The real work is done in a new include file, bsd.clean.mk.
* A new variable, CLEANDIRFILES, contains a list of files to be
deleted by "make cleandir", analogous to the existing CLEANFILES
variable used by "make clean".
* Other bsd.*.mk files no longer define their own "clean" or
"cleandir" targets; instead, they append to the CLEANFILES or
CLEANDIRFILES variables, and .include <bsd.clean.mk>. (There were
some cases where the CLEANFILES variable was used by a cleandir
target; these have been changed to use the CLEANDIRFILES variable
instead.)
* If ${.OBJDIR} and ${.CURDIR} are different, then "make clean" and
"make cleandir" delete files from both directories.
--apb (Alan Barrett)
Index: share/mk/bsd.README
===================================================================
--- share/mk/bsd.README 30 Jun 2011 18:13:51 -0000 1.284
(Continue reading)
RSS Feed