@matheusbsbs / matheus-bagliano / commits / 54dadbdb29
Fork 0

Makefile: rebuild git.o on version change, clean up git$X flags

Commit 334d28ae factored out git.o as an intermediate stage between git.c and git$X. However: - It left some no-longer-relevant flags in the rule for git$X. - It failed to replace git$X with git.o in the list of files that record GIT_VERSION. This broke incorporation of a changed GIT_VERSION into git$X because, when GIT_VERSION changes, git.o isn't remade and git$X is relinked from the git.o that still contains the old GIT_VERSION. This patch removes the irrelevant flags and fixes incorporation of a changed GIT_VERSION into git$X. Signed-off-by: Matt McCutchen <hashproduct@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Matt McCutchen committed Jul 9, 2007 at 21:30 UTC 54dadbdb29668fbd51effefd0a0c65d915f5422b
1 file changed +2 -3
Makefile
+2 -3
@@ -753,8 +753,7 @@ git.o: git.c common-cmds.h GIT-CFLAGS
753 $(ALL_CFLAGS) -c $(filter %.c,$^)
754
755 git$X: git.o $(BUILTIN_OBJS) $(GITLIBS)
756 - $(QUIET_LINK)$(CC) -DGIT_VERSION='"$(GIT_VERSION)"' \
757 - $(ALL_CFLAGS) -o $@ $(filter %.c,$^) git.o \
756 + $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ git.o \
757 $(BUILTIN_OBJS) $(ALL_LDFLAGS) $(LIBS)
758
759 help.o: common-cmds.h
@@ -857,7 +856,7 @@ configure: configure.ac
856 rm -f $<+
857
858 # These can record GIT_VERSION
860 -git$X git.spec \
859 +git.o git.spec \
860 $(patsubst %.sh,%,$(SCRIPT_SH)) \
861 $(patsubst %.perl,%,$(SCRIPT_PERL)) \
862 : GIT-VERSION-FILE