Skip to content

Commit

Permalink
Makefile: rebuild git.o on version change, clean up git$X flags
Browse files Browse the repository at this point in the history
Commit 334d28a 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>
  • Loading branch information
Matt McCutchen authored and Junio C Hamano committed Jul 10, 2007
1 parent 52aaf64 commit 54dadbd
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -753,8 +753,7 @@ git.o: git.c common-cmds.h GIT-CFLAGS
$(ALL_CFLAGS) -c $(filter %.c,$^)

git$X: git.o $(BUILTIN_OBJS) $(GITLIBS)
$(QUIET_LINK)$(CC) -DGIT_VERSION='"$(GIT_VERSION)"' \
$(ALL_CFLAGS) -o $@ $(filter %.c,$^) git.o \
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ git.o \
$(BUILTIN_OBJS) $(ALL_LDFLAGS) $(LIBS)

help.o: common-cmds.h
Expand Down Expand Up @@ -857,7 +856,7 @@ configure: configure.ac
rm -f $<+

# These can record GIT_VERSION
git$X git.spec \
git.o git.spec \
$(patsubst %.sh,%,$(SCRIPT_SH)) \
$(patsubst %.perl,%,$(SCRIPT_PERL)) \
: GIT-VERSION-FILE
Expand Down

0 comments on commit 54dadbd

Please sign in to comment.