Merge branch 'maint' to sync with 1.5.2.5
[gitweb.git] / Makefile
index 0d904a93b9e9c6ef58edd96f189fa8a4a9c5f9b8..4eb463797adc693dc168b926b6932ff53f17d0b1 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -94,9 +94,9 @@ all::
 # Define OLD_ICONV if your library has an old iconv(), where the second
 # (input buffer pointer) parameter is declared with type (const char **).
 #
-# Define NO_R_TO_GCC if your gcc does not like "-R/path/lib" that
-# tells runtime paths to dynamic libraries; "-Wl,-rpath=/path/lib"
-# is used instead.
+# Define NO_R_TO_GCC_LINKER if your gcc does not like "-R/path/lib"
+# that tells runtime paths to dynamic libraries;
+# "-Wl,-rpath=/path/lib" is used instead.
 #
 # Define USE_NSEC below if you want git to care about sub-second file mtimes
 # and ctimes. Note that you need recent glibc (at least 2.2.4) for this, and
@@ -112,8 +112,6 @@ all::
 # Define NO_PERL_MAKEMAKER if you cannot use Makefiles generated by perl's
 # MakeMaker (e.g. using ActiveState under Cygwin).
 #
-# Define WITH_P4IMPORT to build and install Python git-p4import script.
-#
 # Define NO_TCLTK if you do not want Tcl/Tk GUI.
 #
 # The TCL_PATH variable governs the location of the Tcl interpreter
@@ -153,6 +151,7 @@ sysconfdir = /etc
 else
 sysconfdir = $(prefix)/etc
 endif
+lib = lib
 ETC_GITCONFIG = $(sysconfdir)/gitconfig
 # DESTDIR=
 
@@ -176,7 +175,9 @@ export prefix bindir gitexecdir sharedir template_dir sysconfdir
 
 CC = gcc
 AR = ar
+RM = rm -f
 TAR = tar
+FIND = find
 INSTALL = install
 RPMBUILD = rpmbuild
 TCL_PATH = tclsh
@@ -204,15 +205,15 @@ SCRIPT_SH = \
        git-fetch.sh \
        git-ls-remote.sh \
        git-merge-one-file.sh git-mergetool.sh git-parse-remote.sh \
-       git-pull.sh git-rebase.sh \
+       git-pull.sh git-rebase.sh git-rebase--interactive.sh \
        git-repack.sh git-request-pull.sh git-reset.sh \
        git-sh-setup.sh \
-       git-tag.sh git-verify-tag.sh \
        git-am.sh \
        git-merge.sh git-merge-stupid.sh git-merge-octopus.sh \
        git-merge-resolve.sh git-merge-ours.sh \
        git-lost-found.sh git-quiltimport.sh git-submodule.sh \
-       git-filter-branch.sh
+       git-filter-branch.sh \
+       git-stash.sh
 
 SCRIPT_PERL = \
        git-add--interactive.perl \
@@ -221,20 +222,9 @@ SCRIPT_PERL = \
        git-svnimport.perl git-cvsexportcommit.perl \
        git-send-email.perl git-svn.perl
 
-SCRIPT_PYTHON = \
-       git-p4import.py
-
-ifdef WITH_P4IMPORT
-SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH)) \
-         $(patsubst %.perl,%,$(SCRIPT_PERL)) \
-         $(patsubst %.py,%,$(SCRIPT_PYTHON)) \
-         git-status git-instaweb
-else
 SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH)) \
          $(patsubst %.perl,%,$(SCRIPT_PERL)) \
          git-status git-instaweb
-endif
-
 
 # ... and all the rest that could be moved out of bindir to gitexecdir
 PROGRAMS = \
@@ -284,9 +274,6 @@ endif
 ifndef PERL_PATH
        PERL_PATH = /usr/bin/perl
 endif
-ifndef PYTHON_PATH
-       PYTHON_PATH = /usr/local/bin/python
-endif
 
 export PERL_PATH
 
@@ -375,18 +362,20 @@ BUILTIN_OBJS = \
        builtin-show-branch.o \
        builtin-stripspace.o \
        builtin-symbolic-ref.o \
+       builtin-tag.o \
        builtin-tar-tree.o \
        builtin-unpack-objects.o \
        builtin-update-index.o \
        builtin-update-ref.o \
        builtin-upload-archive.o \
        builtin-verify-pack.o \
+       builtin-verify-tag.o \
        builtin-write-tree.o \
        builtin-show-ref.o \
        builtin-pack-refs.o
 
 GITLIBS = $(LIB_FILE) $(XDIFF_LIB)
-EXTLIBS = -lz
+EXTLIBS =
 
 #
 # Platform specific tweaks
@@ -470,6 +459,10 @@ ifeq ($(uname_S),AIX)
        NO_STRLCPY = YesPlease
        NEEDS_LIBICONV=YesPlease
 endif
+ifeq ($(uname_S),GNU)
+       # GNU/Hurd
+       NO_STRLCPY=YesPlease
+endif
 ifeq ($(uname_S),IRIX64)
        NO_IPV6=YesPlease
        NO_SETENV=YesPlease
@@ -513,9 +506,9 @@ endif
 
 ifndef NO_CURL
        ifdef CURLDIR
-               # Try "-Wl,-rpath=$(CURLDIR)/lib" in such a case.
+               # Try "-Wl,-rpath=$(CURLDIR)/$(lib)" in such a case.
                BASIC_CFLAGS += -I$(CURLDIR)/include
-               CURL_LIBCURL = -L$(CURLDIR)/lib $(CC_LD_DYNPATH)$(CURLDIR)/lib -lcurl
+               CURL_LIBCURL = -L$(CURLDIR)/$(lib) $(CC_LD_DYNPATH)$(CURLDIR)/$(lib) -lcurl
        else
                CURL_LIBCURL = -lcurl
        endif
@@ -531,11 +524,17 @@ ifndef NO_CURL
        endif
 endif
 
+ifdef ZLIB_PATH
+       BASIC_CFLAGS += -I$(ZLIB_PATH)/include
+       EXTLIBS += -L$(ZLIB_PATH)/$(lib) $(CC_LD_DYNPATH)$(ZLIB_PATH)/$(lib)
+endif
+EXTLIBS += -lz
+
 ifndef NO_OPENSSL
        OPENSSL_LIBSSL = -lssl
        ifdef OPENSSLDIR
                BASIC_CFLAGS += -I$(OPENSSLDIR)/include
-               OPENSSL_LINK = -L$(OPENSSLDIR)/lib $(CC_LD_DYNPATH)$(OPENSSLDIR)/lib
+               OPENSSL_LINK = -L$(OPENSSLDIR)/$(lib) $(CC_LD_DYNPATH)$(OPENSSLDIR)/$(lib)
        else
                OPENSSL_LINK =
        endif
@@ -552,7 +551,7 @@ endif
 ifdef NEEDS_LIBICONV
        ifdef ICONVDIR
                BASIC_CFLAGS += -I$(ICONVDIR)/include
-               ICONV_LINK = -L$(ICONVDIR)/lib $(CC_LD_DYNPATH)$(ICONVDIR)/lib
+               ICONV_LINK = -L$(ICONVDIR)/$(lib) $(CC_LD_DYNPATH)$(ICONVDIR)/$(lib)
        else
                ICONV_LINK =
        endif
@@ -709,7 +708,6 @@ prefix_SQ = $(subst ','\'',$(prefix))
 
 SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
 PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH))
-PYTHON_PATH_SQ = $(subst ','\'',$(PYTHON_PATH))
 TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH))
 
 LIBS = $(GITLIBS) $(EXTLIBS)
@@ -728,7 +726,7 @@ export TAR INSTALL DESTDIR SHELL_PATH
 
 all:: $(ALL_PROGRAMS) $(BUILT_INS) $(OTHER_PROGRAMS)
 ifneq (,$X)
-       $(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), rm -f '$p';)
+       $(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), $(RM) '$p';)
 endif
 
 all::
@@ -742,7 +740,7 @@ strip: $(PROGRAMS) git$X
        $(STRIP) $(STRIP_OPTS) $(PROGRAMS) git$X
 
 gitk-wish: gitk GIT-GUI-VARS
-       $(QUIET_GEN)rm -f $@ $@+ && \
+       $(QUIET_GEN)$(RM) $@ $@+ && \
        sed -e '1,3s|^exec .* "$$0"|exec $(subst |,'\|',$(TCLTK_PATH_SQ)) "$$0"|' <gitk >$@+ && \
        chmod +x $@+ && \
        mv -f $@+ $@
@@ -752,17 +750,16 @@ 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
 
 git-merge-subtree$X: git-merge-recursive$X
-       $(QUIET_BUILT_IN)rm -f $@ && ln git-merge-recursive$X $@
+       $(QUIET_BUILT_IN)$(RM) $@ && ln git-merge-recursive$X $@
 
 $(BUILT_INS): git$X
-       $(QUIET_BUILT_IN)rm -f $@ && ln git$X $@
+       $(QUIET_BUILT_IN)$(RM) $@ && ln git$X $@
 
 common-cmds.h: ./generate-cmdlist.sh
 
@@ -770,7 +767,7 @@ common-cmds.h: $(wildcard Documentation/git-*.txt)
        $(QUIET_GEN)./generate-cmdlist.sh > $@+ && mv $@+ $@
 
 $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
-       $(QUIET_GEN)rm -f $@ $@+ && \
+       $(QUIET_GEN)$(RM) $@ $@+ && \
        sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
            -e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \
            -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
@@ -781,20 +778,11 @@ $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
 
 $(patsubst %.perl,%,$(SCRIPT_PERL)): perl/perl.mak
 
-$(patsubst %.py,%,$(SCRIPT_PYTHON)) : % : %.py
-       rm -f $@ $@+
-       sed -e '1s|#!.*/python|#!$(PYTHON_PATH_SQ)|' \
-           -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
-           -e 's/@@NO_CURL@@/$(NO_CURL)/g' \
-           $@.py >$@+
-       chmod +x $@+
-       mv $@+ $@
-
 perl/perl.mak: GIT-CFLAGS
        $(QUIET_SUBDIR0)perl $(QUIET_SUBDIR1) PERL_PATH='$(PERL_PATH_SQ)' prefix='$(prefix_SQ)' $(@F)
 
 $(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl
-       $(QUIET_GEN)rm -f $@ $@+ && \
+       $(QUIET_GEN)$(RM) $@ $@+ && \
        INSTLIBDIR=`$(MAKE) -C perl -s --no-print-directory instlibdir` && \
        sed -e '1{' \
            -e '        s|#!.*perl|#!$(PERL_PATH_SQ)|' \
@@ -813,7 +801,7 @@ git-status: git-commit
        $(QUIET_GEN)cp $< $@+ && mv $@+ $@
 
 gitweb/gitweb.cgi: gitweb/gitweb.perl
-       $(QUIET_GEN)rm -f $@ $@+ && \
+       $(QUIET_GEN)$(RM) $@ $@+ && \
        sed -e '1s|#!.*perl|#!$(PERL_PATH_SQ)|' \
            -e 's|++GIT_VERSION++|$(GIT_VERSION)|g' \
            -e 's|++GIT_BINDIR++|$(bindir)|g' \
@@ -836,7 +824,7 @@ gitweb/gitweb.cgi: gitweb/gitweb.perl
        mv $@+ $@
 
 git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/gitweb.css
-       $(QUIET_GEN)rm -f $@ $@+ && \
+       $(QUIET_GEN)$(RM) $@ $@+ && \
        sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
            -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
            -e 's/@@NO_CURL@@/$(NO_CURL)/g' \
@@ -849,14 +837,14 @@ git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/gitweb.css
        mv $@+ $@
 
 configure: configure.ac
-       $(QUIET_GEN)rm -f $@ $<+ && \
+       $(QUIET_GEN)$(RM) $@ $<+ && \
        sed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
            $< > $<+ && \
        autoconf -o $@ $<+ && \
-       rm -f $<+
+       $(RM) $<+
 
 # These can record GIT_VERSION
-git$X git.spec \
+git.o git.spec \
        $(patsubst %.sh,%,$(SCRIPT_SH)) \
        $(patsubst %.perl,%,$(SCRIPT_PERL)) \
        : GIT-VERSION-FILE
@@ -908,7 +896,7 @@ $(patsubst git-%$X,%.o,$(PROGRAMS)): $(LIB_H) $(wildcard */*.h)
 $(DIFF_OBJS): diffcore.h
 
 $(LIB_FILE): $(LIB_OBJS)
-       $(QUIET_AR)rm -f $@ && $(AR) rcs $@ $(LIB_OBJS)
+       $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIB_OBJS)
 
 XDIFF_OBJS=xdiff/xdiffi.o xdiff/xprepare.o xdiff/xutils.o xdiff/xemit.o \
        xdiff/xmerge.o
@@ -916,7 +904,7 @@ $(XDIFF_OBJS): xdiff/xinclude.h xdiff/xmacros.h xdiff/xdiff.h xdiff/xtypes.h \
        xdiff/xutils.h xdiff/xprepare.h xdiff/xdiffi.h xdiff/xemit.h
 
 $(XDIFF_LIB): $(XDIFF_OBJS)
-       $(QUIET_AR)rm -f $@ && $(AR) rcs $@ $(XDIFF_OBJS)
+       $(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(XDIFF_OBJS)
 
 
 perl/Makefile: perl/Git.pm perl/Makefile.PL GIT-CFLAGS
@@ -926,13 +914,16 @@ perl/Makefile: perl/Git.pm perl/Makefile.PL GIT-CFLAGS
 doc:
        $(MAKE) -C Documentation all
 
+info:
+       $(MAKE) -C Documentation info
+
 TAGS:
-       rm -f TAGS
-       find . -name '*.[hcS]' -print | xargs etags -a
+       $(RM) TAGS
+       $(FIND) . -name '*.[hcS]' -print | xargs etags -a
 
 tags:
-       rm -f tags
-       find . -name '*.[hcS]' -print | xargs ctags -a
+       $(RM) tags
+       $(FIND) . -name '*.[hcS]' -print | xargs ctags -a
 
 ### Detect prefix changes
 TRACK_CFLAGS = $(subst ','\'',$(ALL_CFLAGS)):\
@@ -961,7 +952,7 @@ endif
 
 ### Testing rules
 
-TEST_PROGRAMS = test-chmtime$X test-genrandom$X test-date$X test-delta$X test-sha1$X test-match-trees$X
+TEST_PROGRAMS = test-chmtime$X test-genrandom$X test-date$X test-delta$X test-sha1$X test-match-trees$X test-absolute-path$X
 
 all:: $(TEST_PROGRAMS)
 
@@ -987,7 +978,8 @@ check-sha1:: test-sha1$X
 check: common-cmds.h
        for i in *.c; do sparse $(ALL_CFLAGS) $(SPARSE_FLAGS) $$i || exit; done
 
-
+remove-dashes:
+       ./fixup-builtins $(BUILT_INS)
 
 ### Installation rules
 
@@ -1009,14 +1001,17 @@ endif
                cp '$(DESTDIR_SQ)$(bindir_SQ)/git$X' \
                        '$(DESTDIR_SQ)$(gitexecdir_SQ)/git$X'; \
        fi
-       $(foreach p,$(BUILT_INS), rm -f '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' && ln '$(DESTDIR_SQ)$(gitexecdir_SQ)/git$X' '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' ;)
+       $(foreach p,$(BUILT_INS), $(RM) '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' && ln '$(DESTDIR_SQ)$(gitexecdir_SQ)/git$X' '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' ;)
 ifneq (,$X)
-       $(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), rm -f '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p';)
+       $(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), $(RM) '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p';)
 endif
 
 install-doc:
        $(MAKE) -C Documentation install
 
+install-info:
+       $(MAKE) -C Documentation install-info
+
 quick-install-doc:
        $(MAKE) -C Documentation quick-install
 
@@ -1029,18 +1024,19 @@ git.spec: git.spec.in
        mv $@+ $@
 
 GIT_TARNAME=git-$(GIT_VERSION)
-dist: git.spec git-archive
+dist: git.spec git-archive configure
        ./git-archive --format=tar \
                --prefix=$(GIT_TARNAME)/ HEAD^{tree} > $(GIT_TARNAME).tar
        @mkdir -p $(GIT_TARNAME)
-       @cp git.spec $(GIT_TARNAME)
+       @cp git.spec configure $(GIT_TARNAME)
        @echo $(GIT_VERSION) > $(GIT_TARNAME)/version
        @$(MAKE) -C git-gui TARDIR=../$(GIT_TARNAME)/git-gui dist-version
        $(TAR) rf $(GIT_TARNAME).tar \
                $(GIT_TARNAME)/git.spec \
+               $(GIT_TARNAME)/configure \
                $(GIT_TARNAME)/version \
                $(GIT_TARNAME)/git-gui/version
-       @rm -rf $(GIT_TARNAME)
+       @$(RM) -r $(GIT_TARNAME)
        gzip -f -9 $(GIT_TARNAME).tar
 
 rpm: dist
@@ -1049,13 +1045,13 @@ rpm: dist
 htmldocs = git-htmldocs-$(GIT_VERSION)
 manpages = git-manpages-$(GIT_VERSION)
 dist-doc:
-       rm -fr .doc-tmp-dir
+       $(RM) -r .doc-tmp-dir
        mkdir .doc-tmp-dir
        $(MAKE) -C Documentation WEBDOC_DEST=../.doc-tmp-dir install-webdoc
        cd .doc-tmp-dir && $(TAR) cf ../$(htmldocs).tar .
        gzip -n -9 -f $(htmldocs).tar
        :
-       rm -fr .doc-tmp-dir
+       $(RM) -r .doc-tmp-dir
        mkdir -p .doc-tmp-dir/man1 .doc-tmp-dir/man5 .doc-tmp-dir/man7
        $(MAKE) -C Documentation DESTDIR=./ \
                man1dir=../.doc-tmp-dir/man1 \
@@ -1064,31 +1060,31 @@ dist-doc:
                install
        cd .doc-tmp-dir && $(TAR) cf ../$(manpages).tar .
        gzip -n -9 -f $(manpages).tar
-       rm -fr .doc-tmp-dir
+       $(RM) -r .doc-tmp-dir
 
 ### Cleaning rules
 
 clean:
-       rm -f *.o mozilla-sha1/*.o arm/*.o ppc/*.o compat/*.o xdiff/*.o \
+       $(RM) *.o mozilla-sha1/*.o arm/*.o ppc/*.o compat/*.o xdiff/*.o \
                $(LIB_FILE) $(XDIFF_LIB)
-       rm -f $(ALL_PROGRAMS) $(BUILT_INS) git$X
-       rm -f $(TEST_PROGRAMS)
-       rm -f *.spec *.pyc *.pyo */*.pyc */*.pyo common-cmds.h TAGS tags
-       rm -rf autom4te.cache
-       rm -f configure config.log config.mak.autogen config.mak.append config.status config.cache
-       rm -rf $(GIT_TARNAME) .doc-tmp-dir
-       rm -f $(GIT_TARNAME).tar.gz git-core_$(GIT_VERSION)-*.tar.gz
-       rm -f $(htmldocs).tar.gz $(manpages).tar.gz
-       rm -f gitweb/gitweb.cgi
+       $(RM) $(ALL_PROGRAMS) $(BUILT_INS) git$X
+       $(RM) $(TEST_PROGRAMS)
+       $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo common-cmds.h TAGS tags
+       $(RM) -r autom4te.cache
+       $(RM) configure config.log config.mak.autogen config.mak.append config.status config.cache
+       $(RM) -r $(GIT_TARNAME) .doc-tmp-dir
+       $(RM) $(GIT_TARNAME).tar.gz git-core_$(GIT_VERSION)-*.tar.gz
+       $(RM) $(htmldocs).tar.gz $(manpages).tar.gz
+       $(RM) gitweb/gitweb.cgi
        $(MAKE) -C Documentation/ clean
        $(MAKE) -C perl clean
        $(MAKE) -C templates/ clean
        $(MAKE) -C t/ clean
 ifndef NO_TCLTK
-       rm -f gitk-wish
+       $(RM) gitk-wish
        $(MAKE) -C git-gui clean
 endif
-       rm -f GIT-VERSION-FILE GIT-CFLAGS GIT-GUI-VARS
+       $(RM) GIT-VERSION-FILE GIT-CFLAGS GIT-GUI-VARS
 
 .PHONY: all install clean strip
 .PHONY: .FORCE-GIT-VERSION-FILE TAGS tags .FORCE-GIT-CFLAGS