Code

Use configure settings for git-subtree
[git.git] / contrib / subtree / Makefile
1 -include ../../config.mak.autogen
2 -include ../../config.mak
4 prefix ?= /usr/local
5 mandir ?= $(prefix)/share/man
6 gitdir ?= $(shell git --exec-path)
8 gitver ?= $(word 3,$(shell git --version))
10 # this should be set to a 'standard' bsd-type install program
11 INSTALL ?= install
12 INSTALL_DATA = $(INSTALL) -c -m 0644
13 INSTALL_EXE = $(INSTALL) -c -m 0755
14 INSTALL_DIR = $(INSTALL) -c -d -m 0755
16 ASCIIDOC_CONF      = ../../Documentation/asciidoc.conf
17 MANPAGE_NORMAL_XSL =  ../../Documentation/manpage-normal.xsl
19 default:
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
27 install: install-exe install-doc
29 install-exe: git-subtree.sh
30         $(INSTALL_DIR) $(DESTDIR)/$(gitdir)
31         $(INSTALL_EXE) $< $(DESTDIR)/$(gitdir)/git-subtree
33 install-doc: git-subtree.1
34         $(INSTALL_DIR) $(DESTDIR)/$(mandir)/man1/
35         $(INSTALL_DATA) $< $(DESTDIR)/$(mandir)/man1/
37 doc: git-subtree.1
39 %.1: %.xml
40         xmlto -m $(MANPAGE_NORMAL_XSL)  man $^
42 %.xml: %.txt
43         asciidoc -b docbook -d manpage -f $(ASCIIDOC_CONF) \
44                 -agit_version=$(gitver) $^
46 test:
47         ./test.sh
49 clean:
50         rm -f *~ *.xml *.html *.1
51         rm -rf subproj mainline