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 --cc .gitignore
Simple merge
diff --cc Makefile
index dc709029632edc77ac509f24b6352ee48ffa3dc0,af95b70fd9b89e7ba642659a4a3cded0d6af2825..285c660e1454ad3b591660907226fb5b89a3cf4e
+++ b/Makefile
@@@ -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)