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