git/list[1] front-page[2] threads[3] people[4] search[5] about
 

RE: [PATCH] Makefile: don't include git version file on 'make clean'

From
Llynn.lin@emc.com <lynn.lin@emc.com>
Date
Jul 25, 2010, 12:29 UTC
Message-ID
<7F48A44C0E1FBF48B00D4DA49C85432E54F9A0@CORPUSMX100A.corp.emc.com>
In-Reply-To
<7F48A44C0E1FBF48B00D4DA49C85432E54F99F@CORPUSMX100A.corp.emc.com>
-----Original Message-----
From: Lin, Lynn 
Sent: 2010年7月25日 20:22
To: Lin, Lynn; avarab@gmail.com; schwab@linux-m68k.org
Cc: kpfleming@digium.com; git@vger.kernel.org
Subject: RE: [PATCH] Makefile: don't include git version file on 'make clean'
-----Original Message-----
From: git-owner@vger.kernel.org [mailto:git-owner@vger.kernel.org] On Behalf Of lynn.lin@emc.com
Sent: 2010年7月25日 20:19
To: avarab@gmail.com; schwab@linux-m68k.org
Cc: kpfleming@digium.com; git@vger.kernel.org
Subject: RE: [PATCH] Makefile: don't include git version file on 'make clean'
-----Original Message-----
From: Ævar Arnfjörð Bjarmason [mailto:avarab@gmail.com] 
Sent: 2010年7月25日 20:16
To: Andreas Schwab
Cc: Lin, Lynn; 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:05, Andreas Schwab <schwab@linux-m68k.org> wrote:
Show 5 quoted lines
> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
>
>> Makefile targets aren't triggered by the include directive.
>
> Umm, yes they are, see (make) Remaking Makefiles.

Ah, yes. But it was being included in more places than just that -include directive, so I didn't spot the difference:

Without that directive, still generated on make clean:
    $ git diff -U0 | cat
    diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN
    index e88f50c..f29406b 100755
    --- a/GIT-VERSION-GEN
    +++ b/GIT-VERSION-GEN
    @@ -2,0 +3,2 @@
    +echo MOO > /tmp/moo
    +
    diff --git a/Makefile b/Makefile
    index b6975aa..5edfeca 100644
    --- a/Makefile
    +++ b/Makefile
    @@ -241 +240,0 @@ GIT-VERSION-FILE: FORCE
    --include GIT-VERSION-FILE
    $ rm -v /tmp/moo; make clean > /dev/null; cat /tmp/moo
    removed `/tmp/moo'
    GIT_VERSION = 1.7.2.6.g65a0d3.dirty
    GITGUI_VERSION = 0.12.0.64.g89d61-dirty
    MOO

Deleted the rule, not generated, but other things are still calling the rule:

Why not delete the rule? We only handle this on 'make clean' command ('make distclean') target
Sorry.it's typo .Why delete the rule
    $ git diff -U0 | cat
    diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN
    index e88f50c..f29406b 100755
    --- a/GIT-VERSION-GEN
    +++ b/GIT-VERSION-GEN
    @@ -2,0 +3,2 @@
    +echo MOO > /tmp/moo
    +
    diff --git a/Makefile b/Makefile
    index b6975aa..1a189da 100644
    --- a/Makefile
    +++ b/Makefile
    @@ -239,4 +238,0 @@ all::
    -GIT-VERSION-FILE: FORCE
    -       @$(SHELL_PATH) ./GIT-VERSION-GEN
    --include GIT-VERSION-FILE
    -
    $ rm -v /tmp/moo; make clean > /dev/null; cat /tmp/moo
    removed `/tmp/moo'
    make[2]: *** No rule to make target `GIT-VERSION-FILE'.  Stop.
    make[2]: *** No rule to make target `GIT-VERSION-FILE'.  Stop.
    make[2]: *** No rule to make target `GIT-VERSION-FILE'.  Stop.
    GITGUI_VERSION = 0.12.0.64.g89d61-dirty
    cat: /tmp/moo: No such file or directory

NryزXvؖ){nljض}zj:v zZzf~zwڢ)

We have two place to call GIT-VERSION-FILE target in top Makefile
 
git.o git.spec \
        $(patsubst %.sh,%,$(SCRIPT_SH)) \
        $(patsubst %.perl,%,$(SCRIPT_PERL)) \
        : GIT-VERSION-FILE

clean: $(RM) GIT-VERSION-FILE GIT-CFLAGS GIT-GUI-VARS GIT-BUILD-OPTIONS

My patch is to don't call GIT-VERSION-FILE target when you run 'make clean'

Thanks Lynn

Previous: lynn.lin@emc.comNext: Ævar Arnfjörð Bjarmason
Message 14 of 19 in “Makefile: don't include git version file on 'make clean'”
  1. Makefile: don't include git version file on 'make clean'lynn.lin@emc.com, Jul 24, 2010
  2. Ævar Arnfjörð BjarmasonJul 24, 2010
  3. Kevin P. FlemingJul 25, 2010
  4. lynn.lin@emc.comJul 25, 2010
  5. Ævar Arnfjörð BjarmasonJul 25, 2010
  6. lynn.lin@emc.comJul 25, 2010
  7. Ævar Arnfjörð BjarmasonJul 25, 2010
  8. lynn.lin@emc.comJul 25, 2010
  9. Ævar Arnfjörð BjarmasonJul 25, 2010
  10. Andreas SchwabJul 25, 2010
  11. Ævar Arnfjörð BjarmasonJul 25, 2010
  12. lynn.lin@emc.comJul 25, 2010
  13. lynn.lin@emc.comJul 25, 2010
  14. lynn.lin@emc.comJul 25, 2010
  15. Ævar Arnfjörð BjarmasonJul 25, 2010
  16. lynn.lin@emc.comJul 25, 2010
  17. Ævar Arnfjörð BjarmasonJul 25, 2010
  18. lynn.lin@emc.comJul 25, 2010
  19. Patch follow-up conventions (Re: [PATCH] Makefile: don't include git version file on 'make clean')Jonathan Nieder, Jul 25, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.