Merge branch 'jk/replace-edit-raw'
[git] / contrib / subtree / Makefile
1 -include ../../config.mak.autogen
2 -include ../../config.mak
3
4 prefix ?= /usr/local
5 mandir ?= $(prefix)/share/man
6 gitexecdir ?= $(prefix)/libexec/git-core
7 man1dir ?= $(mandir)/man1
8
9 ../../GIT-VERSION-FILE: FORCE
10         $(MAKE) -C ../../ GIT-VERSION-FILE
11
12 -include ../../GIT-VERSION-FILE
13
14 # this should be set to a 'standard' bsd-type install program
15 INSTALL  ?= install
16 RM       ?= rm -f
17
18 ASCIIDOC = asciidoc
19 XMLTO    = xmlto
20
21 ASCIIDOC_CONF = ../../Documentation/asciidoc.conf
22 MANPAGE_XSL   = ../../Documentation/manpage-normal.xsl
23
24 GIT_SUBTREE_SH := git-subtree.sh
25 GIT_SUBTREE    := git-subtree
26
27 GIT_SUBTREE_DOC := git-subtree.1
28 GIT_SUBTREE_XML := git-subtree.xml
29 GIT_SUBTREE_TXT := git-subtree.txt
30 GIT_SUBTREE_HTML := git-subtree.html
31
32 all: $(GIT_SUBTREE)
33
34 $(GIT_SUBTREE): $(GIT_SUBTREE_SH)
35         cp $< $@ && chmod +x $@
36
37 doc: $(GIT_SUBTREE_DOC) $(GIT_SUBTREE_HTML)
38
39 install: $(GIT_SUBTREE)
40         $(INSTALL) -d -m 755 $(DESTDIR)$(gitexecdir)
41         $(INSTALL) -m 755 $(GIT_SUBTREE) $(DESTDIR)$(gitexecdir)
42
43 install-doc: install-man
44
45 install-man: $(GIT_SUBTREE_DOC)
46         $(INSTALL) -d -m 755 $(DESTDIR)$(man1dir)
47         $(INSTALL) -m 644 $^ $(DESTDIR)$(man1dir)
48
49 $(GIT_SUBTREE_DOC): $(GIT_SUBTREE_XML)
50         $(XMLTO) -m $(MANPAGE_XSL) man $^
51
52 $(GIT_SUBTREE_XML): $(GIT_SUBTREE_TXT)
53         $(ASCIIDOC) -b docbook -d manpage -f $(ASCIIDOC_CONF) \
54                 -agit_version=$(GIT_VERSION) $^
55
56 $(GIT_SUBTREE_HTML): $(GIT_SUBTREE_TXT)
57         $(ASCIIDOC) -b xhtml11 -d manpage -f $(ASCIIDOC_CONF) \
58                 -agit_version=$(GIT_VERSION) $^
59
60 test:
61         $(MAKE) -C t/ test
62
63 clean:
64         $(RM) $(GIT_SUBTREE)
65         $(RM) *.xml *.html *.1
66
67 .PHONY: FORCE