git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Running make in contrib/subtree does not create executable
@ 2014-08-17  6:49 Jack Nagel
  2014-08-17  7:07 ` [PATCH] subtree: make "all" default target of Makefile Jeff King
  0 siblings, 1 reply; 2+ messages in thread
From: Jack Nagel @ 2014-08-17  6:49 UTC (permalink / raw)
  To: git

Running "make" in contrib/subtree no longer creates the git-subtree executable:

$ git describe
v2.1.0
$ make -C contrib/subtree
/Library/Developer/CommandLineTools/usr/bin/make -C ../../ GIT-VERSION-FILE
GIT_VERSION = 2.1.0
make[1]: `GIT-VERSION-FILE' is up to date.
/Library/Developer/CommandLineTools/usr/bin/make -C ../../ GIT-VERSION-FILE
make[1]: `GIT-VERSION-FILE' is up to date.
make: `../../GIT-VERSION-FILE' is up to date.
$ ls contrib/subtree/git-subtree
ls: contrib/subtree/git-subtree: No such file or directory

The change appears to be inadvertent. I bisected it to
8e2a5ccad11bc21eb72499133bc884024e299983 ("contrib/subtree/Makefile:
use GIT-VERSION-FILE").

This was reproduced on OS X 10.9 with GNU make 3.81.

-Jack

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH] subtree: make "all" default target of Makefile
  2014-08-17  6:49 Running make in contrib/subtree does not create executable Jack Nagel
@ 2014-08-17  7:07 ` Jeff King
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff King @ 2014-08-17  7:07 UTC (permalink / raw)
  To: Jack Nagel; +Cc: Junio C Hamano, git

You should be able to run "make" in contrib/subtree with no
arguments and get the "all" target. This was broken by
8e2a5cc (contrib/subtree/Makefile: use GIT-VERSION-FILE,
2014-05-06), which put the rule for GIT-VERSION-FILE higher
in the file.

We can fix this by putting an empty "all::" target at the
top of the file. That fixes this instance and future-proofs
against it happening again.

Reported-by: Jack Nagel <jacknagel@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
---
On Sun, Aug 17, 2014 at 01:49:49AM -0500, Jack Nagel wrote:

> $ make -C contrib/subtree
> /Library/Developer/CommandLineTools/usr/bin/make -C ../../ GIT-VERSION-FILE
> GIT_VERSION = 2.1.0
> make[1]: `GIT-VERSION-FILE' is up to date.
> /Library/Developer/CommandLineTools/usr/bin/make -C ../../ GIT-VERSION-FILE
> make[1]: `GIT-VERSION-FILE' is up to date.
> make: `../../GIT-VERSION-FILE' is up to date.
> $ ls contrib/subtree/git-subtree
> ls: contrib/subtree/git-subtree: No such file or directory

Thanks for a clear report. The patch below should fix it. This is the
same trick we use in the top-level Makefile. I notice we don't use it in
t/Makefile or Documentation/Makefile, though. Maybe we should.

I also notice that GIT-VERSION-FILE is included first in the top-level
Makefile, but in contrib/subtree/Makefile it comes after we include
config.mak and friends. I wonder if that would ever matter. I can see
somebody adjusting their config.mak based on the git version, but it's
probably not likely. It would only be used by somebody who compiles
historical git versions a lot (i.e., git devs). And it would require
using make's "simply expanded variables", since regular variables aren't
expanded until point of use. So it seems unlikely that anybody cares.

 contrib/subtree/Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/contrib/subtree/Makefile b/contrib/subtree/Makefile
index d9a0ce2..8deffad 100644
--- a/contrib/subtree/Makefile
+++ b/contrib/subtree/Makefile
@@ -1,3 +1,5 @@
+all::
+
 -include ../../config.mak.autogen
 -include ../../config.mak
 
@@ -34,7 +36,7 @@ GIT_SUBTREE_XML := git-subtree.xml
 GIT_SUBTREE_TXT := git-subtree.txt
 GIT_SUBTREE_HTML := git-subtree.html
 
-all: $(GIT_SUBTREE)
+all:: $(GIT_SUBTREE)
 
 $(GIT_SUBTREE): $(GIT_SUBTREE_SH)
 	sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' $< >$@
-- 
2.1.0.344.gf63f03f

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-08-17  7:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-17  6:49 Running make in contrib/subtree does not create executable Jack Nagel
2014-08-17  7:07 ` [PATCH] subtree: make "all" default target of Makefile Jeff King

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).