qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-trivial] [Qemu-devel] [PATCH] Makefile: Avoid explicit list of


From: Markus Armbruster
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH] Makefile: Avoid explicit list of directories in clean target
Date: Tue, 31 Jul 2012 16:19:47 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux)

Peter Maydell <address@hidden> writes:

> Avoid having an explicit list of directories in the 'clean'
> target by using 'find' to remove all .o and .d files instead.
>
> Signed-off-by: Peter Maydell <address@hidden>
> ---
> I figured that (unlike Makefile.target) we should probably take
> the xargs route here since otherwise the rm command line is huge...
>
> There's also an argument that there's not much point having a clean
> target in Makefile.target when this one blows away most of it anyway.
>
>  Makefile |    7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index 621cb86..9f7eaa8 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -212,13 +212,10 @@ clean:
>  # avoid old build problems by removing potentially incorrect old files
>       rm -f config.mak op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h 
> gen-op-arm.h
>       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?

>       rm -Rf .libs
> -     rm -f slirp/*.o slirp/*.d audio/*.o audio/*.d block/*.o block/*.d 
> net/*.o net/*.d fsdev/*.o fsdev/*.d ui/*.o ui/*.d qapi/*.o qapi/*.d qga/*.o 
> qga/*.d
> -     rm -f qom/*.o qom/*.d
> -     rm -f usb/*.o usb/*.d hw/*.o hw/*.d
>       rm -f qemu-img-cmds.h
> -     rm -f trace/*.o trace/*.d
>       rm -f trace-dtrace.dtrace trace-dtrace.dtrace-timestamp
>       @# May not be present in GENERATED_HEADERS
>       rm -f trace-dtrace.h trace-dtrace.h-timestamp



reply via email to

[Prev in Thread] Current Thread [Next in Thread]