add installation support to Makefile
[git/mingw.git] / Makefile
blobfaefffded5bab03380f2bed8fab65db4c054da43
1 prefix ?= /usr/local
2 mandir ?= $(prefix)/share/man
3 gitdir ?= $(shell git --exec-path)
5 # this should be set to a 'standard' bsd-type install program
6 INSTALL ?= install
7 INSTALL_DATA = $(INSTALL) -c -m 0644
8 INSTALL_EXE = $(INSTALL) -c -m 0755
9 INSTALL_DIR = $(INSTALL) -c -d -m 0755
11 default:
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
18 install: install-exe install-doc
20 install-exe: git-subtree.sh
21 $(INSTALL_DIR) $(DESTDIR)/$(gitdir)
22 $(INSTALL_EXE) $< $(DESTDIR)/$(gitdir)/git-subtree
24 install-doc: git-subtree.1
25 $(INSTALL_DIR) $(DESTDIR)/$(mandir)/man1/
26 $(INSTALL_DATA) $< $(DESTDIR)/$(mandir)/man1/
28 doc: git-subtree.1
30 %.1: %.xml
31 xmlto -m manpage-normal.xsl man $^
33 %.xml: %.txt
34 asciidoc -b docbook -d manpage -f asciidoc.conf \
35 -agit_version=1.6.3 $^
37 clean:
38 rm -f *~ *.xml *.html *.1
39 rm -rf subproj mainline