Merge branch 'jk/make-fix-dependencies'
authorJunio C Hamano <gitster@pobox.com>
Tue, 16 Jun 2015 21:27:06 +0000 (14:27 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 16 Jun 2015 21:27:07 +0000 (14:27 -0700)
Build clean-up.

* jk/make-fix-dependencies:
Makefile: silence perl/PM.stamp recipe
Makefile: avoid timestamp updates to GIT-BUILD-OPTIONS
Makefile: drop dependency between git-instaweb and gitweb

1  2 
Makefile
diff --combined Makefile
index 54ec511dffb0a7b6775f360fc10deaa2008fdee9,f3376e35851b97ccd72f9190687b4a0ee8c084de..149f1c7c3740e9513cc2e35f590b987bbee6f0a4
+++ b/Makefile
@@@ -191,10 -191,6 +191,10 @@@ all:
  # Define NO_TRUSTABLE_FILEMODE if your filesystem may claim to support
  # the executable mode bit, but doesn't really do so.
  #
 +# Define NEEDS_MODE_TRANSLATION if your OS strays from the typical file type
 +# bits in mode values (e.g. z/OS defines I_SFMT to 0xFF000000 as opposed to the
 +# usual 0xF000).
 +#
  # Define NO_IPV6 if you lack IPv6 support and getaddrinfo().
  #
  # Define NO_UNIX_SOCKETS if your system does not offer unix sockets.
  # return NULL when it receives a bogus time_t.
  #
  # Define HAVE_CLOCK_GETTIME if your platform has clock_gettime in librt.
 +#
 +# Define HAVE_CLOCK_MONOTONIC if your platform has CLOCK_MONOTONIC in librt.
 +#
 +# Define NO_HMAC_CTX_CLEANUP if your OpenSSL is version 0.9.6b or earlier to
 +# cleanup the HMAC context with the older HMAC_cleanup function.
 +#
 +# Define USE_PARENS_AROUND_GETTEXT_N to "yes" if your compiler happily
 +# compiles the following initialization:
 +#
 +#   static const char s[] = ("FOO");
 +#
 +# and define it to "no" if you need to remove the parentheses () around the
 +# constant.  The default is "auto", which means to use parentheses if your
 +# compiler is detected to support it.
 +#
 +# Define HAVE_BSD_SYSCTL if your platform has a BSD-compatible sysctl function.
 +#
 +# Define HAVE_GETDELIM if your system has the getdelim() function.
  
  GIT-VERSION-FILE: FORCE
        @$(SHELL_PATH) ./GIT-VERSION-GEN
@@@ -574,7 -552,6 +574,7 @@@ TEST_PROGRAMS_NEED_X += test-dat
  TEST_PROGRAMS_NEED_X += test-delta
  TEST_PROGRAMS_NEED_X += test-dump-cache-tree
  TEST_PROGRAMS_NEED_X += test-dump-split-index
 +TEST_PROGRAMS_NEED_X += test-dump-untracked-cache
  TEST_PROGRAMS_NEED_X += test-genrandom
  TEST_PROGRAMS_NEED_X += test-hashmap
  TEST_PROGRAMS_NEED_X += test-index-version
@@@ -969,14 -946,6 +969,14 @@@ ifneq (,$(SOCKLEN_T)
        BASIC_CFLAGS += -Dsocklen_t=$(SOCKLEN_T)
  endif
  
 +ifeq (yes,$(USE_PARENS_AROUND_GETTEXT_N))
 +      BASIC_CFLAGS += -DUSE_PARENS_AROUND_GETTEXT_N=1
 +else
 +ifeq (no,$(USE_PARENS_AROUND_GETTEXT_N))
 +      BASIC_CFLAGS += -DUSE_PARENS_AROUND_GETTEXT_N=0
 +endif
 +endif
 +
  ifeq ($(uname_S),Darwin)
        ifndef NO_FINK
                ifeq ($(shell test -d /sw/lib && echo y),y)
@@@ -1026,9 -995,6 +1026,9 @@@ ifdef HAVE_ALLOCA_
        BASIC_CFLAGS += -DHAVE_ALLOCA_H
  endif
  
 +IMAP_SEND_BUILDDEPS =
 +IMAP_SEND_LDFLAGS = $(OPENSSL_LINK) $(OPENSSL_LIBSSL) $(LIB_4_CRYPTO)
 +
  ifdef NO_CURL
        BASIC_CFLAGS += -DNO_CURL
        REMOTE_CURL_PRIMARY =
        REMOTE_CURL_NAMES = $(REMOTE_CURL_PRIMARY) $(REMOTE_CURL_ALIASES)
        PROGRAM_OBJS += http-fetch.o
        PROGRAMS += $(REMOTE_CURL_NAMES)
 -      curl_check := $(shell (echo 070908; curl-config --vernum) 2>/dev/null | sort -r | sed -ne 2p)
 +      curl_check := $(shell (echo 070908; curl-config --vernum | sed -e '/^70[BC]/s/^/0/') 2>/dev/null | sort -r | sed -ne 2p)
        ifeq "$(curl_check)" "070908"
                ifndef NO_EXPAT
                        PROGRAM_OBJS += http-push.o
                endif
        endif
 +      curl_check := $(shell (echo 072200; curl-config --vernum | sed -e '/^70[BC]/s/^/0/') 2>/dev/null | sort -r | sed -ne 2p)
 +      ifeq "$(curl_check)" "072200"
 +              USE_CURL_FOR_IMAP_SEND = YesPlease
 +      endif
 +      ifdef USE_CURL_FOR_IMAP_SEND
 +              BASIC_CFLAGS += -DUSE_CURL_FOR_IMAP_SEND
 +              IMAP_SEND_BUILDDEPS = http.o
 +              IMAP_SEND_LDFLAGS += $(CURL_LIBCURL)
 +      endif
        ifndef NO_EXPAT
                ifdef EXPATDIR
                        BASIC_CFLAGS += -I$(EXPATDIR)/include
@@@ -1102,9 -1059,6 +1102,9 @@@ ifndef NO_OPENSS
        ifdef NEEDS_CRYPTO_WITH_SSL
                OPENSSL_LIBSSL += -lcrypto
        endif
 +      ifdef NO_HMAC_CTX_CLEANUP
 +              BASIC_CFLAGS += -DNO_HMAC_CTX_CLEANUP
 +      endif
  else
        BASIC_CFLAGS += -DNO_OPENSSL
        BLK_SHA1 = 1
@@@ -1276,10 -1230,6 +1276,10 @@@ endi
  ifdef NO_TRUSTABLE_FILEMODE
        BASIC_CFLAGS += -DNO_TRUSTABLE_FILEMODE
  endif
 +ifdef NEEDS_MODE_TRANSLATION
 +      COMPAT_CFLAGS += -DNEEDS_MODE_TRANSLATION
 +      COMPAT_OBJS += compat/stat.o
 +endif
  ifdef NO_IPV6
        BASIC_CFLAGS += -DNO_IPV6
  endif
@@@ -1432,18 -1382,6 +1432,18 @@@ ifdef HAVE_CLOCK_GETTIM
        EXTLIBS += -lrt
  endif
  
 +ifdef HAVE_CLOCK_MONOTONIC
 +      BASIC_CFLAGS += -DHAVE_CLOCK_MONOTONIC
 +endif
 +
 +ifdef HAVE_BSD_SYSCTL
 +      BASIC_CFLAGS += -DHAVE_BSD_SYSCTL
 +endif
 +
 +ifdef HAVE_GETDELIM
 +      BASIC_CFLAGS += -DHAVE_GETDELIM
 +endif
 +
  ifeq ($(TCLTK_PATH),)
  NO_TCLTK = NoThanks
  endif
@@@ -1694,10 -1632,10 +1694,10 @@@ $(BUILT_INS): git$
        ln -s $< $@ 2>/dev/null || \
        cp $< $@
  
 -common-cmds.h: ./generate-cmdlist.sh command-list.txt
 +common-cmds.h: generate-cmdlist.perl command-list.txt
  
  common-cmds.h: $(wildcard Documentation/git-*.txt)
 -      $(QUIET_GEN)./generate-cmdlist.sh > $@+ && mv $@+ $@
 +      $(QUIET_GEN)$(PERL_PATH) generate-cmdlist.perl command-list.txt > $@+ && mv $@+ $@
  
  SCRIPT_DEFINES = $(SHELL_PATH_SQ):$(DIFF_SQ):$(GIT_VERSION):\
        $(localedir_SQ):$(NO_CURL):$(USE_GETTEXT_SCHEME):$(SANE_TOOL_PATH_SQ):\
@@@ -1747,7 -1685,7 +1747,7 @@@ $(SCRIPT_PERL_GEN): perl/perl.ma
  perl/perl.mak: perl/PM.stamp
  
  perl/PM.stamp: FORCE
-       $(QUIET_GEN)$(FIND) perl -type f -name '*.pm' | sort >$@+ && \
+       @$(FIND) perl -type f -name '*.pm' | sort >$@+ && \
        { cmp $@+ $@ >/dev/null 2>/dev/null || mv $@+ $@; } && \
        $(RM) $@+
  
@@@ -1784,7 -1722,7 +1784,7 @@@ GIT-PERL-DEFINES: FORC
  gitweb:
        $(QUIET_SUBDIR0)gitweb $(QUIET_SUBDIR1) all
  
- git-instaweb: git-instaweb.sh gitweb GIT-SCRIPT-DEFINES
+ git-instaweb: git-instaweb.sh GIT-SCRIPT-DEFINES
        $(QUIET_GEN)$(cmd_munge_script) && \
        chmod +x $@+ && \
        mv $@+ $@
@@@ -1942,7 -1880,7 +1942,7 @@@ gettext.sp gettext.s gettext.o: GIT-PRE
  gettext.sp gettext.s gettext.o: EXTRA_CPPFLAGS = \
        -DGIT_LOCALE_PATH='"$(localedir_SQ)"'
  
 -http-push.sp http.sp http-walker.sp remote-curl.sp: SPARSE_FLAGS += \
 +http-push.sp http.sp http-walker.sp remote-curl.sp imap-send.sp: SPARSE_FLAGS += \
        -DCURL_DISABLE_TYPECHECK
  
  ifdef NO_EXPAT
@@@ -1963,9 -1901,9 +1963,9 @@@ endi
  git-%$X: %.o GIT-LDFLAGS $(GITLIBS)
        $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
  
 -git-imap-send$X: imap-send.o GIT-LDFLAGS $(GITLIBS)
 +git-imap-send$X: imap-send.o $(IMAP_SEND_BUILDDEPS) GIT-LDFLAGS $(GITLIBS)
        $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
 -              $(LIBS) $(OPENSSL_LINK) $(OPENSSL_LIBSSL) $(LIB_4_CRYPTO)
 +              $(LIBS) $(IMAP_SEND_LDFLAGS)
  
  git-http-fetch$X: http.o http-walker.o http-fetch.o GIT-LDFLAGS $(GITLIBS)
        $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
@@@ -2103,46 -2041,46 +2103,47 @@@ GIT-LDFLAGS: FORC
  # that runs GIT-BUILD-OPTIONS, and then again to protect it
  # and the first level quoting from the shell that runs "echo".
  GIT-BUILD-OPTIONS: FORCE
-       @echo SHELL_PATH=\''$(subst ','\'',$(SHELL_PATH_SQ))'\' >$@
-       @echo PERL_PATH=\''$(subst ','\'',$(PERL_PATH_SQ))'\' >>$@
-       @echo DIFF=\''$(subst ','\'',$(subst ','\'',$(DIFF)))'\' >>$@
-       @echo PYTHON_PATH=\''$(subst ','\'',$(PYTHON_PATH_SQ))'\' >>$@
-       @echo TAR=\''$(subst ','\'',$(subst ','\'',$(TAR)))'\' >>$@
-       @echo NO_CURL=\''$(subst ','\'',$(subst ','\'',$(NO_CURL)))'\' >>$@
-       @echo NO_EXPAT=\''$(subst ','\'',$(subst ','\'',$(NO_EXPAT)))'\' >>$@
-       @echo USE_LIBPCRE=\''$(subst ','\'',$(subst ','\'',$(USE_LIBPCRE)))'\' >>$@
-       @echo NO_PERL=\''$(subst ','\'',$(subst ','\'',$(NO_PERL)))'\' >>$@
-       @echo NO_PYTHON=\''$(subst ','\'',$(subst ','\'',$(NO_PYTHON)))'\' >>$@
-       @echo NO_UNIX_SOCKETS=\''$(subst ','\'',$(subst ','\'',$(NO_UNIX_SOCKETS)))'\' >>$@
+       @echo SHELL_PATH=\''$(subst ','\'',$(SHELL_PATH_SQ))'\' >$@+
+       @echo PERL_PATH=\''$(subst ','\'',$(PERL_PATH_SQ))'\' >>$@+
+       @echo DIFF=\''$(subst ','\'',$(subst ','\'',$(DIFF)))'\' >>$@+
+       @echo PYTHON_PATH=\''$(subst ','\'',$(PYTHON_PATH_SQ))'\' >>$@+
+       @echo TAR=\''$(subst ','\'',$(subst ','\'',$(TAR)))'\' >>$@+
+       @echo NO_CURL=\''$(subst ','\'',$(subst ','\'',$(NO_CURL)))'\' >>$@+
++      @echo NO_EXPAT=\''$(subst ','\'',$(subst ','\'',$(NO_EXPAT)))'\' >>$@+
+       @echo USE_LIBPCRE=\''$(subst ','\'',$(subst ','\'',$(USE_LIBPCRE)))'\' >>$@+
+       @echo NO_PERL=\''$(subst ','\'',$(subst ','\'',$(NO_PERL)))'\' >>$@+
+       @echo NO_PYTHON=\''$(subst ','\'',$(subst ','\'',$(NO_PYTHON)))'\' >>$@+
+       @echo NO_UNIX_SOCKETS=\''$(subst ','\'',$(subst ','\'',$(NO_UNIX_SOCKETS)))'\' >>$@+
  ifdef TEST_OUTPUT_DIRECTORY
-       @echo TEST_OUTPUT_DIRECTORY=\''$(subst ','\'',$(subst ','\'',$(TEST_OUTPUT_DIRECTORY)))'\' >>$@
+       @echo TEST_OUTPUT_DIRECTORY=\''$(subst ','\'',$(subst ','\'',$(TEST_OUTPUT_DIRECTORY)))'\' >>$@+
  endif
  ifdef GIT_TEST_OPTS
-       @echo GIT_TEST_OPTS=\''$(subst ','\'',$(subst ','\'',$(GIT_TEST_OPTS)))'\' >>$@
+       @echo GIT_TEST_OPTS=\''$(subst ','\'',$(subst ','\'',$(GIT_TEST_OPTS)))'\' >>$@+
  endif
  ifdef GIT_TEST_CMP
-       @echo GIT_TEST_CMP=\''$(subst ','\'',$(subst ','\'',$(GIT_TEST_CMP)))'\' >>$@
+       @echo GIT_TEST_CMP=\''$(subst ','\'',$(subst ','\'',$(GIT_TEST_CMP)))'\' >>$@+
  endif
  ifdef GIT_TEST_CMP_USE_COPIED_CONTEXT
-       @echo GIT_TEST_CMP_USE_COPIED_CONTEXT=YesPlease >>$@
+       @echo GIT_TEST_CMP_USE_COPIED_CONTEXT=YesPlease >>$@+
  endif
-       @echo NO_GETTEXT=\''$(subst ','\'',$(subst ','\'',$(NO_GETTEXT)))'\' >>$@
-       @echo GETTEXT_POISON=\''$(subst ','\'',$(subst ','\'',$(GETTEXT_POISON)))'\' >>$@
+       @echo NO_GETTEXT=\''$(subst ','\'',$(subst ','\'',$(NO_GETTEXT)))'\' >>$@+
+       @echo GETTEXT_POISON=\''$(subst ','\'',$(subst ','\'',$(GETTEXT_POISON)))'\' >>$@+
  ifdef GIT_PERF_REPEAT_COUNT
-       @echo GIT_PERF_REPEAT_COUNT=\''$(subst ','\'',$(subst ','\'',$(GIT_PERF_REPEAT_COUNT)))'\' >>$@
+       @echo GIT_PERF_REPEAT_COUNT=\''$(subst ','\'',$(subst ','\'',$(GIT_PERF_REPEAT_COUNT)))'\' >>$@+
  endif
  ifdef GIT_PERF_REPO
-       @echo GIT_PERF_REPO=\''$(subst ','\'',$(subst ','\'',$(GIT_PERF_REPO)))'\' >>$@
+       @echo GIT_PERF_REPO=\''$(subst ','\'',$(subst ','\'',$(GIT_PERF_REPO)))'\' >>$@+
  endif
  ifdef GIT_PERF_LARGE_REPO
-       @echo GIT_PERF_LARGE_REPO=\''$(subst ','\'',$(subst ','\'',$(GIT_PERF_LARGE_REPO)))'\' >>$@
+       @echo GIT_PERF_LARGE_REPO=\''$(subst ','\'',$(subst ','\'',$(GIT_PERF_LARGE_REPO)))'\' >>$@+
  endif
  ifdef GIT_PERF_MAKE_OPTS
-       @echo GIT_PERF_MAKE_OPTS=\''$(subst ','\'',$(subst ','\'',$(GIT_PERF_MAKE_OPTS)))'\' >>$@
+       @echo GIT_PERF_MAKE_OPTS=\''$(subst ','\'',$(subst ','\'',$(GIT_PERF_MAKE_OPTS)))'\' >>$@+
  endif
  ifdef TEST_GIT_INDEX_VERSION
-       @echo TEST_GIT_INDEX_VERSION=\''$(subst ','\'',$(subst ','\'',$(TEST_GIT_INDEX_VERSION)))'\' >>$@
+       @echo TEST_GIT_INDEX_VERSION=\''$(subst ','\'',$(subst ','\'',$(TEST_GIT_INDEX_VERSION)))'\' >>$@+
  endif
+       @if cmp $@+ $@ >/dev/null 2>&1; then $(RM) $@+; else mv $@+ $@; fi
  
  ### Detect Python interpreter path changes
  ifndef NO_PYTHON
@@@ -2455,7 -2393,7 +2456,7 @@@ check-docs:
                esac ; \
                test -f "Documentation/$$v.txt" || \
                echo "no doc: $$v"; \
 -              sed -e '/^#/d' command-list.txt | \
 +              sed -e '1,/^### command list/d' -e '/^#/d' command-list.txt | \
                grep -q "^$$v[  ]" || \
                case "$$v" in \
                git) ;; \
                esac ; \
        done; \
        ( \
 -              sed -e '/^#/d' \
 +              sed -e '1,/^### command list/d' \
 +                  -e '/^#/d' \
                    -e 's/[     ].*//' \
                    -e 's/^/listed /' command-list.txt; \
                $(MAKE) -C Documentation print-man1 | \