diff mbox

[U-Boot,1/2] Add a "tidy" build option

Message ID 1321918844-19597-1-git-send-email-afleming@freescale.com
State Accepted
Delegated to: Wolfgang Denk
Headers show

Commit Message

Andy Fleming Nov. 21, 2011, 11:40 p.m. UTC
It is sometimes desireable to clean up the byproducts of the build
process without removing the executable results. "make clean" is
close, but leaves the build directory with a large number of
*.depend* files. This new build option invokes make clean, and then
removes the depend files.

Signed-off-by: Andy Fleming <afleming@freescale.com>
---
 Makefile |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

Comments

Simon Glass Nov. 22, 2011, 2:28 a.m. UTC | #1
Hi Andy,

On Mon, Nov 21, 2011 at 3:40 PM, Andy Fleming <afleming@freescale.com> wrote:
> It is sometimes desireable to clean up the byproducts of the build
> process without removing the executable results. "make clean" is
> close, but leaves the build directory with a large number of
> *.depend* files. This new build option invokes make clean, and then
> removes the depend files.

Rather than adding another target, why not just make the 'clean' target do this?

It would also be useful IMO to put a comment in the Makefile as to
what the targets are for. I think it is something like:

clean - cleans all intermediate files
clobber - as clean, and cleans all output files also
distclean - as clobber, but also removes entire output directory if O= is used

Regards,
Simon

>
> Signed-off-by: Andy Fleming <afleming@freescale.com>
> ---
>  Makefile |   13 ++++++++-----
>  1 files changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index fb658f4..0beb083 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -777,11 +777,14 @@ clean:
>                -o -name '*.o'  -o -name '*.a' -o -name '*.exe' \) -print \
>                | xargs rm -f
>
> -clobber:       clean
> -       @find $(OBJTREE) -type f \( -name '*.depend*' \
> -               -o -name '*.srec' -o -name '*.bin' -o -name u-boot.img \) \
> -               -print0 \
> -               | xargs -0 rm -f
> +# Removes everything not needed for testing u-boot
> +tidy:  clean
> +       @find $(OBJTREE) -type f \( -name '*.depend*' \) -print | xargs rm -f
> +
> +clobber:       tidy
> +       @find $(OBJTREE) -type f \( -name '*.srec' \
> +               -o -name '*.bin' -o -name u-boot.img \) \
> +               -print0 | xargs -0 rm -f
>        @rm -f $(OBJS) $(obj)*.bak $(obj)ctags $(obj)etags $(obj)TAGS \
>                $(obj)cscope.* $(obj)*.*~
>        @rm -f $(obj)u-boot $(obj)u-boot.map $(obj)u-boot.hex $(ALL-y)
> --
> 1.7.3.4
>
>
> _______________________________________________
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
Wolfgang Denk Dec. 6, 2011, 8:34 p.m. UTC | #2
Dear Andy Fleming,

In message <1321918844-19597-1-git-send-email-afleming@freescale.com> you wrote:
> It is sometimes desireable to clean up the byproducts of the build
> process without removing the executable results. "make clean" is
> close, but leaves the build directory with a large number of
> *.depend* files. This new build option invokes make clean, and then
> removes the depend files.
> 
> Signed-off-by: Andy Fleming <afleming@freescale.com>
> ---
>  Makefile |   13 ++++++++-----
>  1 files changed, 8 insertions(+), 5 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk
diff mbox

Patch

diff --git a/Makefile b/Makefile
index fb658f4..0beb083 100644
--- a/Makefile
+++ b/Makefile
@@ -777,11 +777,14 @@  clean:
 		-o -name '*.o'	-o -name '*.a' -o -name '*.exe'	\) -print \
 		| xargs rm -f
 
-clobber:	clean
-	@find $(OBJTREE) -type f \( -name '*.depend*' \
-		-o -name '*.srec' -o -name '*.bin' -o -name u-boot.img \) \
-		-print0 \
-		| xargs -0 rm -f
+# Removes everything not needed for testing u-boot
+tidy:	clean
+	@find $(OBJTREE) -type f \( -name '*.depend*' \) -print | xargs rm -f
+
+clobber:	tidy
+	@find $(OBJTREE) -type f \( -name '*.srec' \
+		-o -name '*.bin' -o -name u-boot.img \) \
+		-print0 | xargs -0 rm -f
 	@rm -f $(OBJS) $(obj)*.bak $(obj)ctags $(obj)etags $(obj)TAGS \
 		$(obj)cscope.* $(obj)*.*~
 	@rm -f $(obj)u-boot $(obj)u-boot.map $(obj)u-boot.hex $(ALL-y)