From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:41945) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwDNw-0005DD-QJ for qemu-devel@nongnu.org; Tue, 31 Jul 2012 10:25:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SwDNv-0008DP-4e for qemu-devel@nongnu.org; Tue, 31 Jul 2012 10:25:20 -0400 Message-ID: <5017EABA.1020005@redhat.com> Date: Tue, 31 Jul 2012 08:24:58 -0600 From: Eric Blake MIME-Version: 1.0 References: <1343739695-7757-1-git-send-email-peter.maydell@linaro.org> <87pq7c9fng.fsf@blackfin.pond.sub.org> In-Reply-To: <87pq7c9fng.fsf@blackfin.pond.sub.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig9750D98629B8A5D748141D9F" Subject: Re: [Qemu-devel] [PATCH] Makefile: Avoid explicit list of directories in clean target List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: Peter Maydell , patches@linaro.org, qemu-trivial@nongnu.org, Stefan Weil , qemu-devel@nongnu.org, Jan Kiszka , Stefan Hajnoczi This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig9750D98629B8A5D748141D9F Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 07/31/2012 08:19 AM, Markus Armbruster wrote: > Peter Maydell writes: >=20 >> Avoid having an explicit list of directories in the 'clean' >> target by using 'find' to remove all .o and .d files instead. >> >> rm -f qemu-options.def >> - rm -f *.o *.d *.a *.lo $(TOOLS) $(HELPERS-y) qemu-ga TAGS cscope.* *= =2Epod *~ */*~ >> + find . -name '*.[od]' | xargs rm -f >> + rm -f *.a *.lo $(TOOLS) $(HELPERS-y) qemu-ga TAGS cscope.* *.pod *~ = */*~ >=20 > Shit happens if you somehow manage to create a "mean" file name in the > build tree. Sure you don't want to -print0 | xargs -0? Except that 'find -print0' and 'xargs -0' are both GNU extensions, not available everywhere. We may be requiring gmake and gcc, but are we also requiring GNU find? The POSIX way to write this, without relying on extensions, is: find . -name '*.[od]' -exec rm -f {} + (although then you get into the arguments of whether 'find -exec {} +' is portable yet, even though it has now been required by POSIX for more than 4 years.) --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enig9750D98629B8A5D748141D9F Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJQF+q6AAoJEKeha0olJ0NqxLsH/3T6tbJusjkRoUntujgAEsgy ruH0w5ON4e2jXaIvV7/VXiZ1ooG0bX74r76q3DcKfcWVUKyRrUyO6E5MA6ORnCLY pIfDoutbiNPmpgnPLSRg0FqNrN3nlSEP4KJag/9r2nu2+RuoCE/YSMUIGlLKY2ON LtP9XccBDtvbu7/JAKoyBzdO+If4656DUnE+v6q1TSMQX6n2Pl5hTsvo4bPAWVDm 7RBbYRzkQdtyV2kgKnmnAd2GNh9ccSdeg1ivLVy/mdgBLZ4Yua53Yx7Z+U12UHDh tZ3uewuTBxBK6cUrhoQPKLHM3vMzfbuM17Q5hhPryDXw4+jBxjQPeD9ulc23wv0= =Y7YL -----END PGP SIGNATURE----- --------------enig9750D98629B8A5D748141D9F--