From: Jeff King Date: Wed, 20 Jun 2012 18:32:22 +0000 (-0400) Subject: Makefile: move GIT-VERSION-FILE dependencies closer to use X-Git-Tag: v1.7.12-rc0~29^2~1 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=520a6cdce3531867110df012d62d4974376eba1f;p=git.git 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 Signed-off-by: Junio C Hamano --- diff --git a/Makefile b/Makefile index 87ef77706..5e43050da 100644 --- a/Makefile +++ b/Makefile @@ -1991,7 +1991,7 @@ builtin/help.sp builtin/help.s builtin/help.o: EXTRA_CPPFLAGS = \ '-DGIT_MAN_PATH="$(mandir_SQ)"' \ '-DGIT_INFO_PATH="$(infodir_SQ)"' -version.sp version.s version.o: GIT-USER-AGENT +version.sp version.s version.o: GIT-VERSION-FILE GIT-USER-AGENT version.sp version.s version.o: EXTRA_CPPFLAGS = \ '-DGIT_VERSION="$(GIT_VERSION)"' \ '-DGIT_USER_AGENT=$(GIT_USER_AGENT_CQ_SQ)' @@ -2047,7 +2047,7 @@ $(patsubst %.perl,%,$(SCRIPT_PERL)): perl/perl.mak perl/perl.mak: GIT-CFLAGS GIT-PREFIX perl/Makefile perl/Makefile.PL $(QUIET_SUBDIR0)perl $(QUIET_SUBDIR1) PERL_PATH='$(PERL_PATH_SQ)' prefix='$(prefix_SQ)' $(@F) -$(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl +$(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl GIT-VERSION-FILE $(QUIET_GEN)$(RM) $@ $@+ && \ INSTLIBDIR=`MAKEFLAGS= $(MAKE) -C perl -s --no-print-directory instlibdir` && \ sed -e '1{' \ @@ -2104,18 +2104,13 @@ $(patsubst %.py,%,$(SCRIPT_PYTHON)): % : unimplemented.sh mv $@+ $@ endif # NO_PYTHON -configure: configure.ac +configure: configure.ac GIT-VERSION-FILE $(QUIET_GEN)$(RM) $@ $<+ && \ sed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \ $< > $<+ && \ autoconf -o $@ $<+ && \ $(RM) $<+ -# These can record GIT_VERSION -version.o git.spec \ - $(patsubst %.perl,%,$(SCRIPT_PERL)) \ - : GIT-VERSION-FILE - XDIFF_OBJS += xdiff/xdiffi.o XDIFF_OBJS += xdiff/xprepare.o XDIFF_OBJS += xdiff/xutils.o @@ -2650,7 +2645,7 @@ quick-install-html: ### Maintainer's dist rules -git.spec: git.spec.in +git.spec: git.spec.in GIT-VERSION-FILE sed -e 's/@@VERSION@@/$(GIT_VERSION)/g' < $< > $@+ mv $@+ $@