Makefile: move GIT-VERSION-FILE dependencies closer to use

There is a list of all of the targets which depend on GIT-VERSION-FILE, but it can be quite far from the actual point where the targets actually use $(GIT_VERSION). This can make it hard to verify that each use of $(GIT_VERSION) has a matching dependency. This patch moves the dependency closer to the actual build instructions, which makes verification easier. This also fixes the generation of "configure", which did not properly mark the dependency. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Jun 20, 2012 at 14:32 UTC 520a6cdce3531867110df012d62d4974376eba1f
1 file changed +4 -9
Makefile
+4 -9
@@ -1991,7 +1991,7 @@ builtin/help.sp builtin/help.s builtin/help.o: EXTRA_CPPFLAGS = \
1991 '-DGIT_MAN_PATH="$(mandir_SQ)"' \
1992 '-DGIT_INFO_PATH="$(infodir_SQ)"'
1993
1994 -version.sp version.s version.o: GIT-USER-AGENT
1994 +version.sp version.s version.o: GIT-VERSION-FILE GIT-USER-AGENT
1995 version.sp version.s version.o: EXTRA_CPPFLAGS = \
1996 '-DGIT_VERSION="$(GIT_VERSION)"' \
1997 '-DGIT_USER_AGENT=$(GIT_USER_AGENT_CQ_SQ)'
@@ -2047,7 +2047,7 @@ $(patsubst %.perl,%,$(SCRIPT_PERL)): perl/perl.mak
2047 perl/perl.mak: GIT-CFLAGS GIT-PREFIX perl/Makefile perl/Makefile.PL
2048 $(QUIET_SUBDIR0)perl $(QUIET_SUBDIR1) PERL_PATH='$(PERL_PATH_SQ)' prefix='$(prefix_SQ)' $(@F)
2049
2050 -$(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl
2050 +$(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl GIT-VERSION-FILE
2051 $(QUIET_GEN)$(RM) $@ $@+ && \
2052 INSTLIBDIR=`MAKEFLAGS= $(MAKE) -C perl -s --no-print-directory instlibdir` && \
2053 sed -e '1{' \
@@ -2104,18 +2104,13 @@ $(patsubst %.py,%,$(SCRIPT_PYTHON)): % : unimplemented.sh
2104 mv $@+ $@
2105 endif # NO_PYTHON
2106
2107 -configure: configure.ac
2107 +configure: configure.ac GIT-VERSION-FILE
2108 $(QUIET_GEN)$(RM) $@ $<+ && \
2109 sed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
2110 $< > $<+ && \
2111 autoconf -o $@ $<+ && \
2112 $(RM) $<+
2113
2114 -# These can record GIT_VERSION
2115 -version.o git.spec \
2116 - $(patsubst %.perl,%,$(SCRIPT_PERL)) \
2117 - : GIT-VERSION-FILE
2118 -
2114 XDIFF_OBJS += xdiff/xdiffi.o
2115 XDIFF_OBJS += xdiff/xprepare.o
2116 XDIFF_OBJS += xdiff/xutils.o
@@ -2650,7 +2645,7 @@ quick-install-html:
2645
2646 ### Maintainer's dist rules
2647
2653 -git.spec: git.spec.in
2648 +git.spec: git.spec.in GIT-VERSION-FILE
2649 sed -e 's/@@VERSION@@/$(GIT_VERSION)/g' < $< > $@+
2650 mv $@+ $@
2651