qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
	patches@linaro.org, qemu-trivial@nongnu.org,
	Stefan Weil <sw@weilnetz.de>,
	qemu-devel@nongnu.org, Jan Kiszka <jan.kiszka@siemens.com>,
	Stefan Hajnoczi <stefanha@gmail.com>
Subject: Re: [Qemu-devel] [PATCH] Makefile: Avoid explicit list of directories in clean target
Date: Tue, 31 Jul 2012 08:24:58 -0600	[thread overview]
Message-ID: <5017EABA.1020005@redhat.com> (raw)
In-Reply-To: <87pq7c9fng.fsf@blackfin.pond.sub.org>

[-- Attachment #1: Type: text/plain, Size: 1169 bytes --]

On 07/31/2012 08:19 AM, Markus Armbruster wrote:
> Peter Maydell <peter.maydell@linaro.org> writes:
> 
>> 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.* *.pod *~ */*~
>> +	find . -name '*.[od]' | xargs rm -f
>> +	rm -f *.a *.lo $(TOOLS) $(HELPERS-y) qemu-ga TAGS cscope.* *.pod *~ */*~
> 
> 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.)

-- 
Eric Blake   eblake@redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 620 bytes --]

  parent reply	other threads:[~2012-07-31 14:25 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-31 13:01 [Qemu-devel] [PATCH] Makefile: Avoid explicit list of directories in clean target Peter Maydell
2012-07-31 13:25 ` Stefan Hajnoczi
2012-07-31 14:19 ` Markus Armbruster
2012-07-31 14:21   ` Peter Maydell
2012-07-31 14:35     ` Markus Armbruster
2012-07-31 14:38       ` Daniel P. Berrange
2012-07-31 15:00         ` Peter Maydell
2012-07-31 15:49           ` Stefan Weil
2012-07-31 15:51             ` Peter Maydell
2012-07-31 16:20               ` Stefan Weil
2012-07-31 17:02                 ` Blue Swirl
2012-07-31 14:24   ` Eric Blake [this message]
2012-08-01 10:28     ` Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5017EABA.1020005@redhat.com \
    --to=eblake@redhat.com \
    --cc=armbru@redhat.com \
    --cc=jan.kiszka@siemens.com \
    --cc=patches@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=stefanha@gmail.com \
    --cc=sw@weilnetz.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).