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