1 # The default target of this Makefile is...
4 -include ../../config.mak.autogen
5 -include ../../config.mak
8 gitexecdir ?= $(prefix)/libexec/git-core
9 mandir ?= $(prefix)/share/man
10 man1dir ?= $(mandir)/man1
11 htmldir ?= $(prefix)/share/doc/git-doc
13 ../../GIT-VERSION-FILE: FORCE
14 $(MAKE) -C ../../ GIT-VERSION-FILE
16 -include ../../GIT-VERSION-FILE
18 # this should be set to a 'standard' bsd-type install program
23 ASCIIDOC_CONF = -f ../../Documentation/asciidoc.conf
24 ASCIIDOC_HTML = xhtml11
25 ASCIIDOC_DOCBOOK = docbook
30 ASCIIDOC = asciidoctor
32 ASCIIDOC_HTML = xhtml5
33 ASCIIDOC_DOCBOOK = docbook45
34 ASCIIDOC_EXTRA += -I../../Documentation -rasciidoctor-extensions
35 ASCIIDOC_EXTRA += -alitdd='&\#x2d;&\#x2d;'
41 SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
43 MANPAGE_XSL = ../../Documentation/manpage-normal.xsl
45 GIT_SUBTREE_SH := git-subtree.sh
46 GIT_SUBTREE := git-subtree
48 GIT_SUBTREE_DOC := git-subtree.1
49 GIT_SUBTREE_XML := git-subtree.xml
50 GIT_SUBTREE_TXT := git-subtree.txt
51 GIT_SUBTREE_HTML := git-subtree.html
52 GIT_SUBTREE_TEST := ../../git-subtree
56 $(GIT_SUBTREE): $(GIT_SUBTREE_SH)
57 sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' $< >$@
60 doc: $(GIT_SUBTREE_DOC) $(GIT_SUBTREE_HTML)
62 install: $(GIT_SUBTREE)
63 $(INSTALL) -d -m 755 $(DESTDIR)$(gitexecdir)
64 $(INSTALL) -m 755 $(GIT_SUBTREE) $(DESTDIR)$(gitexecdir)
66 install-doc: install-man install-html
68 install-man: $(GIT_SUBTREE_DOC)
69 $(INSTALL) -d -m 755 $(DESTDIR)$(man1dir)
70 $(INSTALL) -m 644 $^ $(DESTDIR)$(man1dir)
72 install-html: $(GIT_SUBTREE_HTML)
73 $(INSTALL) -d -m 755 $(DESTDIR)$(htmldir)
74 $(INSTALL) -m 644 $^ $(DESTDIR)$(htmldir)
76 $(GIT_SUBTREE_DOC): $(GIT_SUBTREE_XML)
77 $(XMLTO) -m $(MANPAGE_XSL) man $^
79 $(GIT_SUBTREE_XML): $(GIT_SUBTREE_TXT)
80 $(ASCIIDOC) -b $(ASCIIDOC_DOCBOOK) -d manpage $(ASCIIDOC_CONF) \
81 -agit_version=$(GIT_VERSION) $(ASCIIDOC_EXTRA) $^
83 $(GIT_SUBTREE_HTML): $(GIT_SUBTREE_TXT)
84 $(ASCIIDOC) -b $(ASCIIDOC_HTML) -d manpage $(ASCIIDOC_CONF) \
85 -agit_version=$(GIT_VERSION) $(ASCIIDOC_EXTRA) $^
87 $(GIT_SUBTREE_TEST): $(GIT_SUBTREE)
90 test: $(GIT_SUBTREE_TEST)
95 $(RM) *.xml *.html *.1