1-include ../../config.mak.autogen
2-include ../../config.mak
3
4prefix ?= /usr/local
5mandir ?= $(prefix)/share/man
6gitexecdir ?= $(prefix)/libexec/git-core
7man1dir ?= $(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
15INSTALL ?= install
16
17ASCIIDOC_CONF = ../../Documentation/asciidoc.conf
18MANPAGE_NORMAL_XSL = ../../Documentation/manpage-normal.xsl
19
20GIT_SUBTREE_SH := git-subtree.sh
21GIT_SUBTREE := git-subtree
22
23GIT_SUBTREE_DOC := git-subtree.1
24GIT_SUBTREE_XML := git-subtree.xml
25GIT_SUBTREE_TXT := git-subtree.txt
26GIT_SUBTREE_HTML := git-subtree.html
27
28all: $(GIT_SUBTREE)
29
30$(GIT_SUBTREE): $(GIT_SUBTREE_SH)
31 cp $< $@ && chmod +x $@
32
33doc: $(GIT_SUBTREE_DOC) $(GIT_SUBTREE_HTML)
34
35install: $(GIT_SUBTREE)
36 $(INSTALL) -d -m 755 $(DESTDIR)$(gitexecdir)
37 $(INSTALL) -m 755 $(GIT_SUBTREE) $(DESTDIR)$(gitexecdir)
38
39install-doc: install-man
40
41install-man: $(GIT_SUBTREE_DOC)
42 $(INSTALL) -d -m 755 $(DESTDIR)$(man1dir)
43 $(INSTALL) -m 644 $^ $(DESTDIR)$(man1dir)
44
45$(GIT_SUBTREE_DOC): $(GIT_SUBTREE_XML)
46 xmlto -m $(MANPAGE_NORMAL_XSL) man $^
47
48$(GIT_SUBTREE_XML): $(GIT_SUBTREE_TXT)
49 asciidoc -b docbook -d manpage -f $(ASCIIDOC_CONF) \
50 -agit_version=$(GIT_VERSION) $^
51
52$(GIT_SUBTREE_HTML): $(GIT_SUBTREE_TXT)
53 asciidoc -b xhtml11 -d manpage -f $(ASCIIDOC_CONF) \
54 -agit_version=$(GIT_VERSION) $^
55
56test:
57 $(MAKE) -C t/ test
58
59clean:
60 rm -f *~ *.xml *.html *.1
61 rm -rf subproj mainline
62
63.PHONY: FORCE