Merge branch 'jn/makefile-cleanup'
authorJunio C Hamano <gitster@pobox.com>
Mon, 16 Jul 2012 04:39:17 +0000 (21:39 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 16 Jul 2012 04:39:17 +0000 (21:39 -0700)
Tightens dependency rules to avoid unnecessary recompilation, and
cleans up our Makefile in general.

* jn/makefile-cleanup:
Makefile: document ground rules for target-specific dependencies
Makefile: move GIT-VERSION-FILE dependencies closer to use
Makefile: build instaweb similar to other scripts
Makefile: update scripts when build-time parameters change
Makefile: do not replace @@GIT_VERSION@@ in shell scripts
Makefile: split prefix flags from GIT-CFLAGS
Makefile: be silent when only GIT_USER_AGENT changes
Makefile: split GIT_USER_AGENT from GIT-CFLAGS
Makefile: do not replace @@GIT_USER_AGENT@@ in scripts
Makefile: apply dependencies consistently to sparse/asm targets
Makefile: do not have git.o depend on common-cmds.h
Makefile: fold XDIFF_H and VCSSVN_H into LIB_H
Makefile: fold MISC_H into LIB_H
Makefile: sort LIB_H list

1  2 
.gitignore
Makefile
diff --combined .gitignore
index c188d0b461f170b4a59a3a97d34861d29b299774,6535cd73ad13a84645969b9ad10e64f045ce4072..bb5c91e712349686ccd008d9ccfd5fa8c2320834
@@@ -2,6 -2,9 +2,9 @@@
  /GIT-CFLAGS
  /GIT-LDFLAGS
  /GIT-GUI-VARS
+ /GIT-PREFIX
+ /GIT-SCRIPT-DEFINES
+ /GIT-USER-AGENT
  /GIT-VERSION-FILE
  /bin-wrappers/
  /git
@@@ -31,7 -34,6 +34,7 @@@
  /git-commit-tree
  /git-config
  /git-count-objects
 +/git-credential
  /git-credential-cache
  /git-credential-cache--daemon
  /git-credential-store
  /gitweb/static/gitweb.js
  /gitweb/static/gitweb.min.*
  /test-chmtime
 -/test-credential
  /test-ctype
  /test-date
  /test-delta
diff --combined Makefile
index dc709029632edc77ac509f24b6352ee48ffa3dc0,af95b70fd9b89e7ba642659a4a3cded0d6af2825..285c660e1454ad3b591660907226fb5b89a3cf4e
+++ b/Makefile
@@@ -158,9 -158,6 +158,9 @@@ all:
  # Define NO_PREAD if you have a problem with pread() system call (e.g.
  # cygwin1.dll before v1.5.22).
  #
 +# Define NO_THREAD_SAFE_PREAD if your pread() implementation is not
 +# thread-safe. (e.g. compat/pread.c or cygwin)
 +#
  # Define NO_FAST_WORKING_DIRECTORY if accessing objects in pack files is
  # generally faster on your platform than accessing the working directory.
  #
  # Define NO_ST_BLOCKS_IN_STRUCT_STAT if your platform does not have st_blocks
  # field that counts the on-disk footprint in 512-byte blocks.
  #
 -# Define ASCIIDOC7 if you want to format documentation with AsciiDoc 7
 -#
  # Define DOCBOOK_XSL_172 if you want to format man pages with DocBook XSL v1.72
  # (not v1.73 or v1.71).
  #
  #
  # Define GIT_USER_AGENT if you want to change how git identifies itself during
  # network interactions.  The default is "git/$(GIT_VERSION)".
 +#
 +# Define DEFAULT_HELP_FORMAT to "man", "info" or "html"
 +# (defaults to "man") if you want to have a different default when
 +# "git help" is called without a parameter specifying the format.
  
  GIT-VERSION-FILE: FORCE
        @$(SHELL_PATH) ./GIT-VERSION-GEN
@@@ -397,12 -392,9 +397,9 @@@ BUILTIN_OBJS 
  BUILT_INS =
  COMPAT_CFLAGS =
  COMPAT_OBJS =
- XDIFF_H =
  XDIFF_OBJS =
- VCSSVN_H =
  VCSSVN_OBJS =
- VCSSVN_TEST_OBJS =
- MISC_H =
+ GENERATED_H =
  EXTRA_CPPFLAGS =
  LIB_H =
  LIB_OBJS =
@@@ -488,6 -480,7 +485,6 @@@ X 
  PROGRAMS += $(patsubst %.o,git-%$X,$(PROGRAM_OBJS))
  
  TEST_PROGRAMS_NEED_X += test-chmtime
 -TEST_PROGRAMS_NEED_X += test-credential
  TEST_PROGRAMS_NEED_X += test-ctype
  TEST_PROGRAMS_NEED_X += test-date
  TEST_PROGRAMS_NEED_X += test-delta
@@@ -562,52 -555,43 +559,44 @@@ LIB_FILE=libgit.
  XDIFF_LIB=xdiff/lib.a
  VCSSVN_LIB=vcs-svn/lib.a
  
- XDIFF_H += xdiff/xinclude.h
- XDIFF_H += xdiff/xmacros.h
- XDIFF_H += xdiff/xdiff.h
- XDIFF_H += xdiff/xtypes.h
- XDIFF_H += xdiff/xutils.h
- XDIFF_H += xdiff/xprepare.h
- XDIFF_H += xdiff/xdiffi.h
- XDIFF_H += xdiff/xemit.h
- VCSSVN_H += vcs-svn/line_buffer.h
- VCSSVN_H += vcs-svn/sliding_window.h
- VCSSVN_H += vcs-svn/repo_tree.h
- VCSSVN_H += vcs-svn/fast_export.h
- VCSSVN_H += vcs-svn/svndiff.h
- VCSSVN_H += vcs-svn/svndump.h
- MISC_H += bisect.h
- MISC_H += branch.h
- MISC_H += bundle.h
- MISC_H += common-cmds.h
- MISC_H += fetch-pack.h
- MISC_H += reachable.h
- MISC_H += send-pack.h
- MISC_H += shortlog.h
- MISC_H += tar.h
- MISC_H += thread-utils.h
- MISC_H += url.h
- MISC_H += walker.h
- MISC_H += wt-status.h
+ LIB_H += xdiff/xinclude.h
+ LIB_H += xdiff/xmacros.h
+ LIB_H += xdiff/xdiff.h
+ LIB_H += xdiff/xtypes.h
+ LIB_H += xdiff/xutils.h
+ LIB_H += xdiff/xprepare.h
+ LIB_H += xdiff/xdiffi.h
+ LIB_H += xdiff/xemit.h
+ LIB_H += vcs-svn/line_buffer.h
+ LIB_H += vcs-svn/sliding_window.h
+ LIB_H += vcs-svn/repo_tree.h
+ LIB_H += vcs-svn/fast_export.h
+ LIB_H += vcs-svn/svndiff.h
+ LIB_H += vcs-svn/svndump.h
+ GENERATED_H += common-cmds.h
  
  LIB_H += advice.h
  LIB_H += archive.h
  LIB_H += argv-array.h
  LIB_H += attr.h
+ LIB_H += bisect.h
  LIB_H += blob.h
+ LIB_H += branch.h
  LIB_H += builtin.h
  LIB_H += bulk-checkin.h
- LIB_H += cache.h
+ LIB_H += bundle.h
  LIB_H += cache-tree.h
+ LIB_H += cache.h
  LIB_H += color.h
+ LIB_H += column.h
  LIB_H += commit.h
  LIB_H += compat/bswap.h
  LIB_H += compat/cygwin.h
  LIB_H += compat/mingw.h
  LIB_H += compat/obstack.h
 +LIB_H += compat/precompose_utf8.h
  LIB_H += compat/terminal.h
  LIB_H += compat/win32/dirent.h
  LIB_H += compat/win32/poll.h
@@@ -623,6 -607,7 +612,7 @@@ LIB_H += diff.
  LIB_H += diffcore.h
  LIB_H += dir.h
  LIB_H += exec_cmd.h
+ LIB_H += fetch-pack.h
  LIB_H += fmt-merge-msg.h
  LIB_H += fsck.h
  LIB_H += gettext.h
@@@ -632,6 -617,7 +622,7 @@@ LIB_H += graph.
  LIB_H += grep.h
  LIB_H += hash.h
  LIB_H += help.h
+ LIB_H += http.h
  LIB_H += kwset.h
  LIB_H += levenshtein.h
  LIB_H += list-objects.h
@@@ -641,19 -627,20 +632,20 @@@ LIB_H += mailmap.
  LIB_H += merge-file.h
  LIB_H += merge-recursive.h
  LIB_H += mergesort.h
- LIB_H += notes.h
  LIB_H += notes-cache.h
  LIB_H += notes-merge.h
+ LIB_H += notes.h
  LIB_H += object.h
- LIB_H += pack.h
  LIB_H += pack-refs.h
  LIB_H += pack-revindex.h
+ LIB_H += pack.h
  LIB_H += parse-options.h
  LIB_H += patch-ids.h
  LIB_H += pkt-line.h
  LIB_H += progress.h
  LIB_H += prompt.h
  LIB_H += quote.h
+ LIB_H += reachable.h
  LIB_H += reflog-walk.h
  LIB_H += refs.h
  LIB_H += remote.h
@@@ -661,9 -648,11 +653,11 @@@ LIB_H += rerere.
  LIB_H += resolve-undo.h
  LIB_H += revision.h
  LIB_H += run-command.h
+ LIB_H += send-pack.h
  LIB_H += sequencer.h
  LIB_H += sha1-array.h
  LIB_H += sha1-lookup.h
+ LIB_H += shortlog.h
  LIB_H += sideband.h
  LIB_H += sigchain.h
  LIB_H += strbuf.h
@@@ -671,14 -660,18 +665,18 @@@ LIB_H += streaming.
  LIB_H += string-list.h
  LIB_H += submodule.h
  LIB_H += tag.h
+ LIB_H += tar.h
  LIB_H += thread-utils.h
  LIB_H += transport.h
- LIB_H += tree.h
  LIB_H += tree-walk.h
+ LIB_H += tree.h
  LIB_H += unpack-trees.h
+ LIB_H += url.h
  LIB_H += userdiff.h
  LIB_H += utf8.h
  LIB_H += varint.h
+ LIB_H += walker.h
+ LIB_H += wt-status.h
  LIB_H += xdiff-interface.h
  LIB_H += xdiff/xdiff.h
  
@@@ -836,7 -829,6 +834,7 @@@ BUILTIN_OBJS += builtin/commit-tree.
  BUILTIN_OBJS += builtin/commit.o
  BUILTIN_OBJS += builtin/config.o
  BUILTIN_OBJS += builtin/count-objects.o
 +BUILTIN_OBJS += builtin/credential.o
  BUILTIN_OBJS += builtin/describe.o
  BUILTIN_OBJS += builtin/diff-files.o
  BUILTIN_OBJS += builtin/diff-index.o
@@@ -1002,8 -994,6 +1000,8 @@@ ifeq ($(uname_S),Darwin
        NO_MEMMEM = YesPlease
        USE_ST_TIMESPEC = YesPlease
        HAVE_DEV_TTY = YesPlease
 +      COMPAT_OBJS += compat/precompose_utf8.o
 +      BASIC_CFLAGS += -DPRECOMPOSE_UNICODE
  endif
  ifeq ($(uname_S),SunOS)
        NEEDS_SOCKET = YesPlease
@@@ -1065,7 -1055,6 +1063,7 @@@ ifeq ($(uname_O),Cygwin
                NO_IPV6 = YesPlease
                OLD_ICONV = UnfortunatelyYes
        endif
 +      NO_THREAD_SAFE_PREAD = YesPlease
        NEEDS_LIBICONV = YesPlease
        NO_FAST_WORKING_DIRECTORY = UnfortunatelyYes
        NO_TRUSTABLE_FILEMODE = UnfortunatelyYes
@@@ -1251,7 -1240,6 +1249,7 @@@ ifeq ($(uname_S),Windows
        BLK_SHA1 = YesPlease
        NO_POSIX_GOODIES = UnfortunatelyYes
        NATIVE_CRLF = YesPlease
 +      DEFAULT_HELP_FORMAT = html
  
        CC = compat/vcbuild/scripts/clink.pl
        AR = compat/vcbuild/scripts/lib.pl
@@@ -1675,10 -1663,6 +1673,10 @@@ endi
  ifdef NO_PREAD
        COMPAT_CFLAGS += -DNO_PREAD
        COMPAT_OBJS += compat/pread.o
 +      NO_THREAD_SAFE_PREAD = YesPlease
 +endif
 +ifdef NO_THREAD_SAFE_PREAD
 +      BASIC_CFLAGS += -DNO_THREAD_SAFE_PREAD
  endif
  ifdef NO_FAST_WORKING_DIRECTORY
        BASIC_CFLAGS += -DNO_FAST_WORKING_DIRECTORY
@@@ -1854,6 -1838,10 +1852,6 @@@ ifndef 
  endif
  endif
  
 -ifdef ASCIIDOC7
 -      export ASCIIDOC7
 -endif
 -
  ifdef NO_INSTALL_HARDLINKS
        export NO_INSTALL_HARDLINKS
  endif
@@@ -1934,12 -1922,11 +1932,15 @@@ endi
  GIT_USER_AGENT_SQ = $(subst ','\'',$(GIT_USER_AGENT))
  GIT_USER_AGENT_CQ = "$(subst ",\",$(subst \,\\,$(GIT_USER_AGENT)))"
  GIT_USER_AGENT_CQ_SQ = $(subst ','\'',$(GIT_USER_AGENT_CQ))
- BASIC_CFLAGS += -DGIT_USER_AGENT='$(GIT_USER_AGENT_CQ_SQ)'
+ GIT-USER-AGENT: FORCE
+       @if test x'$(GIT_USER_AGENT_SQ)' != x"`cat GIT-USER-AGENT 2>/dev/null`"; then \
+               echo '$(GIT_USER_AGENT_SQ)' >GIT-USER-AGENT; \
+       fi
  
 +ifdef DEFAULT_HELP_FORMAT
 +BASIC_CFLAGS += -DDEFAULT_HELP_FORMAT='"$(DEFAULT_HELP_FORMAT)"'
 +endif
 +
  ALL_CFLAGS += $(BASIC_CFLAGS)
  ALL_LDFLAGS += $(BASIC_LDFLAGS)
  
@@@ -1986,7 -1973,40 +1987,40 @@@ shell_compatibility_test: please_set_SH
  strip: $(PROGRAMS) git$X
        $(STRIP) $(STRIP_OPTS) $(PROGRAMS) git$X
  
- git.o: common-cmds.h
+ ### Target-specific flags and dependencies
+ # The generic compilation pattern rule and automatically
+ # computed header dependencies (falling back to a dependency on
+ # LIB_H) are enough to describe how most targets should be built,
+ # but some targets are special enough to need something a little
+ # different.
+ #
+ # - When a source file "foo.c" #includes a generated header file,
+ #   we need to list that dependency for the "foo.o" target.
+ #
+ #   We also list it from other targets that are built from foo.c
+ #   like "foo.sp" and "foo.s", even though that is easy to forget
+ #   to do because the generated header is already present around
+ #   after a regular build attempt.
+ #
+ # - Some code depends on configuration kept in makefile
+ #   variables. The target-specific variable EXTRA_CPPFLAGS can
+ #   be used to convey that information to the C preprocessor
+ #   using -D options.
+ #
+ #   The "foo.o" target should have a corresponding dependency on
+ #   a file that changes when the value of the makefile variable
+ #   changes.  For example, targets making use of the
+ #   $(GIT_VERSION) variable depend on GIT-VERSION-FILE.
+ #
+ #   Technically the ".sp" and ".s" targets do not need this
+ #   dependency because they are force-built, but they get the
+ #   same dependency for consistency. This way, you do not have to
+ #   know how each target is implemented. And it means the
+ #   dependencies here will not need to change if the force-build
+ #   details change some day.
+ git.sp git.s git.o: GIT-PREFIX
  git.sp git.s git.o: EXTRA_CPPFLAGS = \
        '-DGIT_HTML_PATH="$(htmldir_SQ)"' \
        '-DGIT_MAN_PATH="$(mandir_SQ)"' \
@@@ -1996,16 -2016,18 +2030,18 @@@ git$X: git.o GIT-LDFLAGS $(BUILTIN_OBJS
        $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ git.o \
                $(BUILTIN_OBJS) $(ALL_LDFLAGS) $(LIBS)
  
- help.sp help.o: common-cmds.h
+ help.sp help.s help.o: common-cmds.h
  
- builtin/help.sp builtin/help.o: common-cmds.h
+ builtin/help.sp builtin/help.s builtin/help.o: common-cmds.h GIT-PREFIX
  builtin/help.sp builtin/help.s builtin/help.o: EXTRA_CPPFLAGS = \
        '-DGIT_HTML_PATH="$(htmldir_SQ)"' \
        '-DGIT_MAN_PATH="$(mandir_SQ)"' \
        '-DGIT_INFO_PATH="$(infodir_SQ)"'
  
+ 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_VERSION="$(GIT_VERSION)"' \
+       '-DGIT_USER_AGENT=$(GIT_USER_AGENT_CQ_SQ)'
  
  $(BUILT_INS): git$X
        $(QUIET_BUILT_IN)$(RM) $@ && \
@@@ -2018,36 -2040,47 +2054,47 @@@ common-cmds.h: ./generate-cmdlist.sh co
  common-cmds.h: $(wildcard Documentation/git-*.txt)
        $(QUIET_GEN)./generate-cmdlist.sh > $@+ && mv $@+ $@
  
+ SCRIPT_DEFINES = $(SHELL_PATH_SQ):$(DIFF_SQ):$(GIT_VERSION):\
+       $(localedir_SQ):$(NO_CURL):$(USE_GETTEXT_SCHEME):$(SANE_TOOL_PATH_SQ):\
+       $(gitwebdir_SQ):$(PERL_PATH_SQ)
  define cmd_munge_script
  $(RM) $@ $@+ && \
  sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
      -e 's|@SHELL_PATH@|$(SHELL_PATH_SQ)|' \
      -e 's|@@DIFF@@|$(DIFF_SQ)|' \
-     -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
-     -e 's|@@GIT_USER_AGENT@@|$(GIT_USER_AGENT_SQ)|g' \
      -e 's|@@LOCALEDIR@@|$(localedir_SQ)|g' \
      -e 's/@@NO_CURL@@/$(NO_CURL)/g' \
      -e 's/@@USE_GETTEXT_SCHEME@@/$(USE_GETTEXT_SCHEME)/g' \
      -e $(BROKEN_PATH_FIX) \
+     -e 's|@@GITWEBDIR@@|$(gitwebdir_SQ)|g' \
+     -e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \
      $@.sh >$@+
  endef
  
- $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
+ GIT-SCRIPT-DEFINES: FORCE
+       @FLAGS='$(SCRIPT_DEFINES)'; \
+           if test x"$$FLAGS" != x"`cat $@ 2>/dev/null`" ; then \
+               echo 1>&2 "    * new script parameters"; \
+               echo "$$FLAGS" >$@; \
+             fi
+ $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh GIT-SCRIPT-DEFINES
        $(QUIET_GEN)$(cmd_munge_script) && \
        chmod +x $@+ && \
        mv $@+ $@
  
- $(SCRIPT_LIB) : % : %.sh
+ $(SCRIPT_LIB) : % : %.sh GIT-SCRIPT-DEFINES
        $(QUIET_GEN)$(cmd_munge_script) && \
        mv $@+ $@
  
  ifndef NO_PERL
  $(patsubst %.perl,%,$(SCRIPT_PERL)): perl/perl.mak
  
- perl/perl.mak: GIT-CFLAGS perl/Makefile perl/Makefile.PL
+ 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{' \
  gitweb:
        $(QUIET_SUBDIR0)gitweb $(QUIET_SUBDIR1) all
  
- git-instaweb: git-instaweb.sh gitweb
-       $(QUIET_GEN)$(RM) $@ $@+ && \
-       sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
-           -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
-           -e 's/@@NO_CURL@@/$(NO_CURL)/g' \
-           -e 's|@@GITWEBDIR@@|$(gitwebdir_SQ)|g' \
-           -e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \
-           $@.sh > $@+ && \
+ git-instaweb: git-instaweb.sh gitweb GIT-SCRIPT-DEFINES
+       $(QUIET_GEN)$(cmd_munge_script) && \
        chmod +x $@+ && \
        mv $@+ $@
  else # NO_PERL
@@@ -2088,7 -2115,7 +2129,7 @@@ $(patsubst %.perl,%,$(SCRIPT_PERL)) git
  endif # NO_PERL
  
  ifndef NO_PYTHON
- $(patsubst %.py,%,$(SCRIPT_PYTHON)): GIT-CFLAGS
+ $(patsubst %.py,%,$(SCRIPT_PYTHON)): GIT-CFLAGS GIT-PREFIX
  $(patsubst %.py,%,$(SCRIPT_PYTHON)): % : %.py
        $(QUIET_GEN)$(RM) $@ $@+ && \
        INSTLIBDIR=`MAKEFLAGS= $(MAKE) -C git_remote_helpers -s \
@@@ -2110,26 -2137,13 +2151,13 @@@ $(patsubst %.py,%,$(SCRIPT_PYTHON)): % 
        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 %.sh,%,$(SCRIPT_SH)) \
-       $(patsubst %.perl,%,$(SCRIPT_PERL)) \
-       : GIT-VERSION-FILE
- TEST_OBJS := $(patsubst test-%$X,test-%.o,$(TEST_PROGRAMS))
- GIT_OBJS := $(LIB_OBJS) $(BUILTIN_OBJS) $(PROGRAM_OBJS) $(TEST_OBJS) \
-       git.o
- ifndef NO_CURL
-       GIT_OBJS += http.o http-walker.o remote-curl.o
- endif
  XDIFF_OBJS += xdiff/xdiffi.o
  XDIFF_OBJS += xdiff/xprepare.o
  XDIFF_OBJS += xdiff/xutils.o
@@@ -2145,9 -2159,14 +2173,14 @@@ VCSSVN_OBJS += vcs-svn/fast_export.
  VCSSVN_OBJS += vcs-svn/svndiff.o
  VCSSVN_OBJS += vcs-svn/svndump.o
  
- VCSSVN_TEST_OBJS += test-line-buffer.o
- OBJECTS := $(GIT_OBJS) $(XDIFF_OBJS) $(VCSSVN_OBJS)
+ TEST_OBJS := $(patsubst test-%$X,test-%.o,$(TEST_PROGRAMS))
+ OBJECTS := $(LIB_OBJS) $(BUILTIN_OBJS) $(PROGRAM_OBJS) $(TEST_OBJS) \
+       $(XDIFF_OBJS) \
+       $(VCSSVN_OBJS) \
+       git.o
+ ifndef NO_CURL
+       OBJECTS += http.o http-walker.o remote-curl.o
+ endif
  
  dep_files := $(foreach f,$(OBJECTS),$(dir $f).depend/$(notdir $f).d)
  dep_dirs := $(addsuffix .depend,$(sort $(dir $(OBJECTS))))
  # Dependencies on automatically generated headers such as common-cmds.h
  # should _not_ be included here, since they are necessary even when
  # building an object for the first time.
- #
- # XXX. Please check occasionally that these include all dependencies
- # gcc detects!
- $(GIT_OBJS): $(LIB_H)
- builtin/branch.o builtin/checkout.o builtin/clone.o builtin/reset.o branch.o transport.o: branch.h
- builtin/bundle.o bundle.o transport.o: bundle.h
- builtin/bisect--helper.o builtin/rev-list.o bisect.o: bisect.h
- builtin/clone.o builtin/fetch-pack.o transport.o: fetch-pack.h
- builtin/index-pack.o builtin/grep.o builtin/pack-objects.o transport-helper.o thread-utils.o: thread-utils.h
- builtin/send-pack.o transport.o: send-pack.h
- builtin/log.o builtin/shortlog.o: shortlog.h
- builtin/prune.o builtin/reflog.o reachable.o: reachable.h
- builtin/commit.o builtin/revert.o wt-status.o: wt-status.h
- builtin/tar-tree.o archive-tar.o: tar.h
- connect.o transport.o url.o http-backend.o: url.h
- builtin/branch.o builtin/commit.o builtin/tag.o column.o help.o pager.o: column.h
- http-fetch.o http-walker.o remote-curl.o transport.o walker.o: walker.h
- http.o http-walker.o http-push.o http-fetch.o remote-curl.o: http.h url.h
- xdiff-interface.o $(XDIFF_OBJS): $(XDIFF_H)
  
- $(VCSSVN_OBJS) $(VCSSVN_TEST_OBJS): $(LIB_H) $(VCSSVN_H)
+ $(OBJECTS): $(LIB_H)
  endif
  
+ exec_cmd.sp exec_cmd.s exec_cmd.o: GIT-PREFIX
  exec_cmd.sp exec_cmd.s exec_cmd.o: EXTRA_CPPFLAGS = \
        '-DGIT_EXEC_PATH="$(gitexecdir_SQ)"' \
        '-DBINDIR="$(bindir_relative_SQ)"' \
        '-DPREFIX="$(prefix_SQ)"'
  
+ builtin/init-db.sp builtin/init-db.s builtin/init-db.o: GIT-PREFIX
  builtin/init-db.sp builtin/init-db.s builtin/init-db.o: EXTRA_CPPFLAGS = \
        -DDEFAULT_GIT_TEMPLATE_DIR='"$(template_dir_SQ)"'
  
+ config.sp config.s config.o: GIT-PREFIX
  config.sp config.s config.o: EXTRA_CPPFLAGS = \
        -DETC_GITCONFIG='"$(ETC_GITCONFIG_SQ)"'
  
+ attr.sp attr.s attr.o: GIT-PREFIX
  attr.sp attr.s attr.o: EXTRA_CPPFLAGS = \
        -DETC_GITATTRIBUTES='"$(ETC_GITATTRIBUTES_SQ)"'
  
+ gettext.sp gettext.s gettext.o: GIT-PREFIX
  gettext.sp gettext.s gettext.o: EXTRA_CPPFLAGS = \
        -DGIT_LOCALE_PATH='"$(localedir_SQ)"'
  
@@@ -2361,7 -2364,7 +2378,7 @@@ XGETTEXT_FLAGS_C = $(XGETTEXT_FLAGS) --
        --keyword=_ --keyword=N_ --keyword="Q_:1,2"
  XGETTEXT_FLAGS_SH = $(XGETTEXT_FLAGS) --language=Shell
  XGETTEXT_FLAGS_PERL = $(XGETTEXT_FLAGS) --keyword=__ --language=Perl
- LOCALIZED_C := $(C_OBJ:o=c) $(LIB_H) $(XDIFF_H) $(VCSSVN_H) $(MISC_H)
+ LOCALIZED_C := $(C_OBJ:o=c) $(LIB_H) $(GENERATED_H)
  LOCALIZED_SH := $(SCRIPT_SH)
  LOCALIZED_PERL := $(SCRIPT_PERL)
  
@@@ -2408,14 -2411,22 +2425,22 @@@ cscope
        $(FIND_SOURCE_FILES) | xargs cscope -b
  
  ### Detect prefix changes
- TRACK_CFLAGS = $(CC):$(subst ','\'',$(ALL_CFLAGS)):\
-              $(bindir_SQ):$(gitexecdir_SQ):$(template_dir_SQ):$(prefix_SQ):\
-              $(localedir_SQ):$(USE_GETTEXT_SCHEME)
+ TRACK_PREFIX = $(bindir_SQ):$(gitexecdir_SQ):$(template_dir_SQ):$(prefix_SQ):\
+               $(localedir_SQ)
+ GIT-PREFIX: FORCE
+       @FLAGS='$(TRACK_PREFIX)'; \
+       if test x"$$FLAGS" != x"`cat GIT-PREFIX 2>/dev/null`" ; then \
+               echo 1>&2 "    * new prefix flags"; \
+               echo "$$FLAGS" >GIT-PREFIX; \
+       fi
+ TRACK_CFLAGS = $(CC):$(subst ','\'',$(ALL_CFLAGS)):$(USE_GETTEXT_SCHEME)
  
  GIT-CFLAGS: FORCE
        @FLAGS='$(TRACK_CFLAGS)'; \
            if test x"$$FLAGS" != x"`cat GIT-CFLAGS 2>/dev/null`" ; then \
-               echo 1>&2 "    * new build flags or prefix"; \
+               echo 1>&2 "    * new build flags"; \
                echo "$$FLAGS" >GIT-CFLAGS; \
              fi
  
@@@ -2667,7 -2678,7 +2692,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 $@+ $@
  
@@@ -2751,6 -2762,7 +2776,7 @@@ ifndef NO_TCLT
        $(MAKE) -C git-gui clean
  endif
        $(RM) GIT-VERSION-FILE GIT-CFLAGS GIT-LDFLAGS GIT-GUI-VARS GIT-BUILD-OPTIONS
+       $(RM) GIT-USER-AGENT GIT-PREFIX GIT-SCRIPT-DEFINES
  
  .PHONY: all install profile-clean clean strip
  .PHONY: shell_compatibility_test please_set_SHELL_PATH_to_a_more_modern_shell