Re: 'make distclean' silently removes empty files

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

 



Hi,

On Thu, Jul 28, 2011 at 8:54 AM, David Howells <dhowells@xxxxxxxxxx> wrote:
>
> Hi,
>
> Can 'make distclean' please be altered to _not_ silently remove empty files,
> especially ones that are checked into GIT and/or are mentioned in Makefiles as
> being compilable.  By all means flag them as requiring removal, remove them
> noisily or give an error.
>
> A case in point is:
>
>        arch/arm/mach-zynq/board_dt.c
>
> which is an empty file checked into GIT.
>
For the record, it is deleted because of the zero size by:

distclean: mrproper
        @find $(srctree) $(RCS_FIND_IGNORE) \
                \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
                -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
                -o -name '.*.rej' -o -size 0 \
                -o -name '*%' -o -name '.*.cmd' -o -name 'core' \) \
                -type f -print | xargs rm -f

in the main makefile.

Could you try:

commit a73f6c8638a75d1bf1bb8b0ace82ddd3b9f0291b
Author: Arnaud Lacombe <lacombar@xxxxxxxxx>
Date:   Thu Jul 28 10:00:33 2011 -0400

    Makefile: do not delete zero-sized C file

diff --git a/Makefile b/Makefile
index d018956..e9ca6ec 100644
--- a/Makefile
+++ b/Makefile
@@ -1198,7 +1198,7 @@ distclean: mrproper
        @find $(srctree) $(RCS_FIND_IGNORE) \
                \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
                -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
-               -o -name '.*.rej' -o -size 0 \
+               -o -name '.*.rej' -o \( -size 0 -a ! -name '*.c' \) \
                -o -name '*%' -o -name '.*.cmd' -o -name 'core' \) \
                -type f -print | xargs rm -f

[space/tab mangled, but the change is obvious]

 - Arnaud

> Thanks,
> David
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux