da805225782289cae31d79d58cf92e9cd89abeb0
   1-include ../../config.mak.autogen
   2-include ../../config.mak
   3
   4prefix ?= /usr/local
   5mandir ?= $(prefix)/share/man
   6gitdir ?= $(shell git --exec-path)
   7
   8gitver ?= $(word 3,$(shell git --version))
   9
  10# this should be set to a 'standard' bsd-type install program
  11INSTALL ?= install
  12INSTALL_DATA = $(INSTALL) -c -m 0644
  13INSTALL_EXE = $(INSTALL) -c -m 0755
  14INSTALL_DIR = $(INSTALL) -c -d -m 0755
  15
  16ASCIIDOC_CONF      = ../../Documentation/asciidoc.conf
  17MANPAGE_NORMAL_XSL =  ../../Documentation/manpage-normal.xsl
  18
  19default:
  20        @echo "git-subtree doesn't need to be built."
  21        @echo "Just copy it somewhere on your PATH, like /usr/local/bin."
  22        @echo
  23        @echo "Try: make doc"
  24        @echo " or: make test"
  25        @false
  26
  27install: install-exe install-doc
  28
  29install-exe: git-subtree.sh
  30        $(INSTALL_DIR) $(DESTDIR)/$(gitdir)
  31        $(INSTALL_EXE) $< $(DESTDIR)/$(gitdir)/git-subtree
  32
  33install-doc: git-subtree.1
  34        $(INSTALL_DIR) $(DESTDIR)/$(mandir)/man1/
  35        $(INSTALL_DATA) $< $(DESTDIR)/$(mandir)/man1/
  36
  37doc: git-subtree.1
  38
  39%.1: %.xml
  40        xmlto -m $(MANPAGE_NORMAL_XSL)  man $^
  41
  42%.xml: %.txt
  43        asciidoc -b docbook -d manpage -f $(ASCIIDOC_CONF) \
  44                -agit_version=$(gitver) $^
  45
  46test:
  47        ./test.sh
  48
  49clean:
  50        rm -f *~ *.xml *.html *.1
  51        rm -rf subproj mainline