Patchwork Makefile.target: Update clean command to clean hw/ directory

login
register
mail settings
Submitter Peter Maydell
Date June 20, 2012, 1:54 p.m.
Message ID <1340200496-17126-1-git-send-email-peter.maydell@linaro.org>
Download mbox | patch
Permalink /patch/166080/
State New
Headers show

Comments

Peter Maydell - June 20, 2012, 1:54 p.m.
Now we create object files in a hierarchy under hw/, so the
'clean' target must also updated to delete those object files.
Rather than using a manual list of subdirectories which will
easily drift out of date, we just delete all .o and .d files
in the target directory hierarchy.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 Makefile.target |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Peter Maydell - June 20, 2012, 1:56 p.m.
On 20 June 2012 14:54, Peter Maydell <peter.maydell@linaro.org> wrote:
> Now we create object files in a hierarchy under hw/, so the
> 'clean' target must also updated to delete those object files.
> Rather than using a manual list of subdirectories which will
> easily drift out of date, we just delete all .o and .d files
> in the target directory hierarchy.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  Makefile.target |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/Makefile.target b/Makefile.target
> index 550d889..686ba8d 100644
> --- a/Makefile.target
> +++ b/Makefile.target
> @@ -193,8 +193,8 @@ qmp-commands-old.h: $(SRC_PATH)/qmp-commands.hx
>        $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"  GEN   $(TARGET_DIR)$@")
>
>  clean:
> -       rm -f *.o *.a *~ $(PROGS) nwfpe/*.o fpu/*.o
> -       rm -f *.d */*.d tcg/*.o ide/*.o 9pfs/*.o kvm/*.o
> +       rm -f *.a *~ $(PROGS)
> +       rm $(shell find . -name '*.[od]')

Forgot the '-f', doh. I'll repost later if nobody complains that
the whole approach is a dumb idea.

>        rm -f hmp-commands.h qmp-commands-old.h gdbstub-xml.c
>  ifdef CONFIG_TRACE_SYSTEMTAP
>        rm -f *.stp
> --

-- PMM
Andreas Färber - June 20, 2012, 1:58 p.m.
Am 20.06.2012 15:54, schrieb Peter Maydell:
> Now we create object files in a hierarchy under hw/, so the
> 'clean' target must also updated to delete those object files.

"be updated"

Other than that and the -f looks good. Thanks.

/-F

> Rather than using a manual list of subdirectories which will
> easily drift out of date, we just delete all .o and .d files
> in the target directory hierarchy.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  Makefile.target |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/Makefile.target b/Makefile.target
> index 550d889..686ba8d 100644
> --- a/Makefile.target
> +++ b/Makefile.target
> @@ -193,8 +193,8 @@ qmp-commands-old.h: $(SRC_PATH)/qmp-commands.hx
>  	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"  GEN   $(TARGET_DIR)$@")
>  
>  clean:
> -	rm -f *.o *.a *~ $(PROGS) nwfpe/*.o fpu/*.o
> -	rm -f *.d */*.d tcg/*.o ide/*.o 9pfs/*.o kvm/*.o
> +	rm -f *.a *~ $(PROGS)
> +	rm $(shell find . -name '*.[od]')
>  	rm -f hmp-commands.h qmp-commands-old.h gdbstub-xml.c
>  ifdef CONFIG_TRACE_SYSTEMTAP
>  	rm -f *.stp

Patch

diff --git a/Makefile.target b/Makefile.target
index 550d889..686ba8d 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -193,8 +193,8 @@  qmp-commands-old.h: $(SRC_PATH)/qmp-commands.hx
 	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"  GEN   $(TARGET_DIR)$@")
 
 clean:
-	rm -f *.o *.a *~ $(PROGS) nwfpe/*.o fpu/*.o
-	rm -f *.d */*.d tcg/*.o ide/*.o 9pfs/*.o kvm/*.o
+	rm -f *.a *~ $(PROGS)
+	rm $(shell find . -name '*.[od]')
 	rm -f hmp-commands.h qmp-commands-old.h gdbstub-xml.c
 ifdef CONFIG_TRACE_SYSTEMTAP
 	rm -f *.stp