1# The default target of this Makefile is...
   2all::
   3-include ../../config.mak.autogen
   5-include ../../config.mak
   6prefix ?= /usr/local
   8gitexecdir ?= $(prefix)/libexec/git-core
   9mandir ?= $(prefix)/share/man
  10man1dir ?= $(mandir)/man1
  11htmldir ?= $(prefix)/share/doc/git-doc
  12../../GIT-VERSION-FILE: FORCE
  14        $(MAKE) -C ../../ GIT-VERSION-FILE
  15-include ../../GIT-VERSION-FILE
  17# this should be set to a 'standard' bsd-type install program
  19INSTALL  ?= install
  20RM       ?= rm -f
  21ASCIIDOC = asciidoc
  23XMLTO    = xmlto
  24ifndef SHELL_PATH
  26        SHELL_PATH = /bin/sh
  27endif
  28SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
  29ASCIIDOC_CONF = ../../Documentation/asciidoc.conf
  31MANPAGE_XSL   = ../../Documentation/manpage-normal.xsl
  32GIT_SUBTREE_SH := git-subtree.sh
  34GIT_SUBTREE    := git-subtree
  35GIT_SUBTREE_DOC := git-subtree.1
  37GIT_SUBTREE_XML := git-subtree.xml
  38GIT_SUBTREE_TXT := git-subtree.txt
  39GIT_SUBTREE_HTML := git-subtree.html
  40GIT_SUBTREE_TEST := ../../git-subtree
  41all:: $(GIT_SUBTREE)
  43$(GIT_SUBTREE): $(GIT_SUBTREE_SH)
  45        sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' $< >$@
  46        chmod +x $@
  47doc: $(GIT_SUBTREE_DOC) $(GIT_SUBTREE_HTML)
  49install: $(GIT_SUBTREE)
  51        $(INSTALL) -d -m 755 $(DESTDIR)$(gitexecdir)
  52        $(INSTALL) -m 755 $(GIT_SUBTREE) $(DESTDIR)$(gitexecdir)
  53install-doc: install-man install-html
  55install-man: $(GIT_SUBTREE_DOC)
  57        $(INSTALL) -d -m 755 $(DESTDIR)$(man1dir)
  58        $(INSTALL) -m 644 $^ $(DESTDIR)$(man1dir)
  59install-html: $(GIT_SUBTREE_HTML)
  61        $(INSTALL) -d -m 755 $(DESTDIR)$(htmldir)
  62        $(INSTALL) -m 644 $^ $(DESTDIR)$(htmldir)
  63$(GIT_SUBTREE_DOC): $(GIT_SUBTREE_XML)
  65        $(XMLTO) -m $(MANPAGE_XSL) man $^
  66$(GIT_SUBTREE_XML): $(GIT_SUBTREE_TXT)
  68        $(ASCIIDOC) -b docbook -d manpage -f $(ASCIIDOC_CONF) \
  69                -agit_version=$(GIT_VERSION) $^
  70$(GIT_SUBTREE_HTML): $(GIT_SUBTREE_TXT)
  72        $(ASCIIDOC) -b xhtml11 -d manpage -f $(ASCIIDOC_CONF) \
  73                -agit_version=$(GIT_VERSION) $^
  74$(GIT_SUBTREE_TEST): $(GIT_SUBTREE)
  76        cp $< $@
  77test: $(GIT_SUBTREE_TEST)
  79        $(MAKE) -C t/ test
  80clean:
  82        $(RM) $(GIT_SUBTREE)
  83        $(RM) *.xml *.html *.1
  84.PHONY: FORCE