Re: [PATCH] Makefile: don't include git version file on 'make clean'
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Jul 25, 2010, 12:15 UTC
- Message-ID
- <AANLkTilK_8wVQG6s8pUrscwd7ZnvgGyjOjJP41uXYfEl@mail.gmail.com>
- In-Reply-To
- <m2d3ubojfr.fsf@igel.home>
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
MOODeleted the rule, not generated, but other things are still calling 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