From owner-cvs-src@FreeBSD.ORG Thu Feb 19 05:41:13 2004 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5C52516A4CF; Thu, 19 Feb 2004 05:41:13 -0800 (PST) Received: from ru.office.ipnet (tigra.ip.net.ua [82.193.96.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 51D0843D1F; Thu, 19 Feb 2004 05:41:11 -0800 (PST) (envelope-from ru@ip.net.ua) Received: (from ru@localhost) by ru.office.ipnet (8.12.10/8.12.10) id i1JDf5nS016178; Thu, 19 Feb 2004 15:41:05 +0200 (EET) (envelope-from ru) Date: Thu, 19 Feb 2004 15:41:04 +0200 From: Ruslan Ermilov To: Garance A Drosehn Message-ID: <20040219134104.GB14981@ip.net.ua> References: <200402162018.i1GKIQK4029731@repoman.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="eJnRUKwClWJh1Khz" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.6i cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src Makefile X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Feb 2004 13:41:13 -0000 --eJnRUKwClWJh1Khz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 17, 2004 at 04:16:34PM -0500, Garance A Drosehn wrote: > At 12:18 PM -0800 2/16/04, Garance A Drosehn wrote: > >gad 2004/02/16 12:18:26 PST > > > > FreeBSD src repository > > > > Modified files: > > . Makefile > > Log: > > Add a 'realclean' target, which simply and quickly removes > > everything that was built in previous 'make buildworld' and > > 'make buildkernel'. >=20 > Just a note on this. The target might need some extra logic so > it is smarter in how it handles some situations, so don't start > using it in documentation just yet. >=20 Sorry, I could not reply earlier, been busy with real life issues, so I'm doing the post-commit review. The committed version has a number of issues, namely: - it's dangerous -- if .OBJDIR doesn't exist, it will wipe away your .CURDIR (typically /usr/src) which will upset many people out there including myself, - it doesn't respect the -s option of make(1) -- the "echo" commands should be spelled ${ECHO} to respect this (see how ECHO is set in sys.mk), - (minor) it uses home-grown style (space after a colon after a target name, -R vs. -r for rm(1), etc.), - the comment mostly repeats what the code does, where it should actually document the intent of this target, not the gory details of how it achives its goal. ;) Also, why "rm -rf ${.OBJDIR}/*" instead of "rm -rf ${.OBJDIR}"? Is it to preserve a possibly symlinked /usr/obj? I suggest to commit the following which fixes all but the last issue mentioned above. %%% Index: Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/Makefile,v retrieving revision 1.293 diff -u -r1.293 Makefile --- Makefile 16 Feb 2004 20:18:25 -0000 1.293 +++ Makefile 19 Feb 2004 12:50:04 -0000 @@ -109,14 +109,12 @@ # The first 'rm' will usually remove all files and directories. If # it does not, then there are probably some files with chflags set. # Unset all special chflags, and try the 'rm' a second time. -realclean : - -rm -Rf ${.OBJDIR}/* 2>/dev/null - @-if [ "`echo ${.OBJDIR}/*`" !=3D "${.OBJDIR}/*" ] ; then \ - echo "chflags -R 0 ${.OBJDIR}/*" ; \ - chflags -R 0 ${.OBJDIR}/* ; \ - echo "rm -Rf ${.OBJDIR}/*" ; \ - rm -Rf ${.OBJDIR}/* ; \ - fi +realclean: +.if ${.OBJDIR} !=3D ${.CURDIR} + -rm -rf ${.OBJDIR}/* 2>/dev/null + -chflags -R 0 ${.OBJDIR}/. + rm -rf ${.OBJDIR}/* +.endif =20 # # Handle the user-driven targets, using the source relative mk files. %%% Cheers, --=20 Ruslan Ermilov FreeBSD committer ru@FreeBSD.org --eJnRUKwClWJh1Khz Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFANLzwUkv4P6juNwoRAlYcAJ4kpld55dTLcbhi3/t0qneXA7yIxACdHb0u z/1PJeUJpU6G6Y4f3toHBG4= =zSWh -----END PGP SIGNATURE----- --eJnRUKwClWJh1Khz--