From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: lynn.lin@emc.com
Cc: schwab@linux-m68k.org, kpfleming@digium.com, git@vger.kernel.org
Subject: Re: [PATCH] Makefile: don't include git version file on 'make clean'
Date: Sun, 25 Jul 2010 13:08:14 +0000 [thread overview]
Message-ID: <AANLkTillxO38RTicjCw8ujzliFIhY3oHYHOCHAvUe7mB@mail.gmail.com> (raw)
In-Reply-To: <7F48A44C0E1FBF48B00D4DA49C85432E54F9A1@CORPUSMX100A.corp.emc.com>
On Sun, Jul 25, 2010 at 12:37, <lynn.lin@emc.com> wrote:
>
>
> -----Original Message-----
> From: Ævar Arnfjörð Bjarmason [mailto:avarab@gmail.com]
> Sent: 2010年7月25日 20:34
> To: Lin, Lynn
> Cc: schwab@linux-m68k.org; kpfleming@digium.com; git@vger.kernel.org
> Subject: Re: [PATCH] Makefile: don't include git version file on 'make clean'
>
> On Sun, Jul 25, 2010 at 12:29, <lynn.lin@emc.com> wrote:
>
>> My patch is to don't call GIT-VERSION-FILE target when you run 'make clean'
>
> Yes, but as I demonstrated it gets called anyway. Presumably because
> of the $(MAKE) -C ... clean rules. But I haven't looked into it.
>
>
> If we don't specify special goals, when we run any target ,it will call GIT-VERSIONF-FILE target as it include this target
>
> Example from GNU make manual:
> http://www.gnu.org/software/autoconf/manual/make/Goals.html
>
>
> An example of appropriate use is to avoid including .d files during clean rules (see Automatic Prerequisites), so make won't create them only to immediately remove them again:
>
> sources = foo.c bar.c
>
> ifneq ($(MAKECMDGOALS),clean)
> include $(sources:.c=.d)
> endif
Yes, I know (now) how include directives work. What I'm saying is that
your patch doesn't work because the main Makefile clean directive
calls *other* makefiles, which in turn include the version file:
$ rm GIT-VERSION-FILE ; make -C gitweb clean; cat GIT-VERSION-FILE
make: Entering directory `/home/avar/g/git/gitweb'
make[1]: Entering directory `/home/avar/g/git'
GIT_VERSION = 1.7.2.6.g65a0d3
make[1]: Leaving directory `/home/avar/g/git'
make[1]: Entering directory `/home/avar/g/git'
make[1]: `GIT-VERSION-FILE' is up to date.
make[1]: Leaving directory `/home/avar/g/git'
make: Leaving directory `/home/avar/g/git/gitweb'
make: Entering directory `/home/avar/g/git/gitweb'
make[1]: Entering directory `/home/avar/g/git'
make[1]: `GIT-VERSION-FILE' is up to date.
make[1]: Leaving directory `/home/avar/g/git'
rm -f gitweb.cgi static/gitweb.min.js static/gitweb.min.css
GITWEB-BUILD-OPTIONS
make: Leaving directory `/home/avar/g/git/gitweb'
GIT_VERSION = 1.7.2.6.g65a0d3
So just removing the inclusion in the main Makefile doesn't do
anything at all.
To get it to work you need to patch the */Makefile files too, and
patch other clean targets like distclean.
But personally I think this whole thing is a bit silly, but others may
disagree. I've said my bit.
Thanks for contributing to Git anyway, your help is appreciated.
next prev parent reply other threads:[~2010-07-25 13:08 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-24 3:53 [PATCH] Makefile: don't include git version file on 'make clean' Lynn.Lin
2010-07-24 12:36 ` Ævar Arnfjörð Bjarmason
2010-07-25 8:49 ` Kevin P. Fleming
2010-07-25 11:28 ` lynn.lin
2010-07-25 11:41 ` Ævar Arnfjörð Bjarmason
2010-07-25 11:46 ` lynn.lin
2010-07-25 11:55 ` Ævar Arnfjörð Bjarmason
2010-07-25 12:02 ` lynn.lin
2010-07-25 12:10 ` Ævar Arnfjörð Bjarmason
2010-07-25 12:05 ` Andreas Schwab
2010-07-25 12:15 ` Ævar Arnfjörð Bjarmason
2010-07-25 12:19 ` lynn.lin
2010-07-25 12:21 ` lynn.lin
2010-07-25 12:29 ` lynn.lin
2010-07-25 12:34 ` Ævar Arnfjörð Bjarmason
2010-07-25 12:37 ` lynn.lin
2010-07-25 13:08 ` Ævar Arnfjörð Bjarmason [this message]
2010-07-25 13:21 ` lynn.lin
2010-07-25 18:49 ` Patch follow-up conventions (Re: [PATCH] Makefile: don't include git version file on 'make clean') Jonathan Nieder
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=AANLkTillxO38RTicjCw8ujzliFIhY3oHYHOCHAvUe7mB@mail.gmail.com \
--to=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=kpfleming@digium.com \
--cc=lynn.lin@emc.com \
--cc=schwab@linux-m68k.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).