Date: Tue, 24 Aug 1999 10:50:04 -0700 (PDT) From: Bruce Evans <bde@zeta.org.au> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/13350: make clean in bsd.obj.mk no longer properly removes *.core and others Message-ID: <199908241750.KAA11069@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/13350; it has been noted by GNATS. 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 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199908241750.KAA11069>