qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Eric Blake <eblake@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, Markus Armbruster <armbru@redhat.com>,
	Jan Kiszka <jan.kiszka@siemens.com>
Subject: Re: [Qemu-devel] [PATCH] Makefile: Avoid explicit list of directories in clean target
Date: Wed, 1 Aug 2012 11:28:10 +0100	[thread overview]
Message-ID: <20120801102810.GA17816@stefanha-thinkpad.localdomain> (raw)
In-Reply-To: <5017EABA.1020005@redhat.com>

On Tue, Jul 31, 2012 at 08:24:58AM -0600, Eric Blake wrote:
> 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.)

This portable approach seems reasonable.  I have checked the find(1) man
page on: FreeBSD, OpenBSD, Solaris 11, Mac OS X.

Let's give find -exec + a shot.  If it breaks something then the folks
who care can provide a buildslave to ensure their host platform
continues to be supported in the future.

Stefan

      reply	other threads:[~2012-08-01 10:28 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
2012-08-01 10:28     ` Stefan Hajnoczi [this message]

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=20120801102810.GA17816@stefanha-thinkpad.localdomain \
    --to=stefanha@gmail.com \
    --cc=armbru@redhat.com \
    --cc=eblake@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=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).