All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaud Lacombe <lacombar@gmail.com>
To: David Howells <dhowells@redhat.com>
Cc: Michal Marek <mmarek@suse.cz>,
	arnd@arndb.de, linux-kbuild@vger.kernel.org
Subject: Re: 'make distclean' silently removes empty files
Date: Thu, 28 Jul 2011 10:01:42 -0400	[thread overview]
Message-ID: <CACqU3MW1x4CNJ+xuikKKhLz1Zd77JSXWLTKA8q7L=W6qUFMbUg@mail.gmail.com> (raw)
In-Reply-To: <25697.1311857663@redhat.com>

Hi,

On Thu, Jul 28, 2011 at 8:54 AM, David Howells <dhowells@redhat.com> 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@gmail.com>
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@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

  reply	other threads:[~2011-07-28 14:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-28 12:54 'make distclean' silently removes empty files David Howells
2011-07-28 14:01 ` Arnaud Lacombe [this message]
2011-08-10 11:16 ` [PATCH] kbuild: Do not delete empty files in make distclean Michal Marek

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='CACqU3MW1x4CNJ+xuikKKhLz1Zd77JSXWLTKA8q7L=W6qUFMbUg@mail.gmail.com' \
    --to=lacombar@gmail.com \
    --cc=arnd@arndb.de \
    --cc=dhowells@redhat.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=mmarek@suse.cz \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.