1-include ../../config.mak.autogen
2-include ../../config.mak
3
4prefix ?= /usr/local
5mandir ?= $(prefix)/share/man
6libexecdir ?= $(prefix)/libexec/git-core
7man1dir ?= $(mandir)/man1
8
9gitver ?= $(word 3,$(shell git --version))
10
11# this should be set to a 'standard' bsd-type install program
12INSTALL ?= install
13
14ASCIIDOC_CONF = ../../Documentation/asciidoc.conf
15MANPAGE_NORMAL_XSL = ../../Documentation/manpage-normal.xsl
16
17GIT_SUBTREE_SH := git-subtree.sh
18GIT_SUBTREE := git-subtree
19
20GIT_SUBTREE_DOC := git-subtree.1
21GIT_SUBTREE_XML := git-subtree.xml
22GIT_SUBTREE_TXT := git-subtree.txt
23GIT_SUBTREE_HTML := git-subtree.html
24
25all: $(GIT_SUBTREE)
26
27$(GIT_SUBTREE): $(GIT_SUBTREE_SH)
28 cp $< $@ && chmod +x $@
29
30doc: $(GIT_SUBTREE_DOC) $(GIT_SUBTREE_HTML)
31
32install: $(GIT_SUBTREE)
33 $(INSTALL) -d -m 755 $(DESTDIR)$(libexecdir)
34 $(INSTALL) -m 755 $(GIT_SUBTREE) $(DESTDIR)$(libexecdir)
35
36install-doc: install-man
37
38install-man: $(GIT_SUBTREE_DOC)
39 $(INSTALL) -d -m 755 $(DESTDIR)$(man1dir)
40 $(INSTALL) -m 644 $^ $(DESTDIR)$(man1dir)
41
42$(GIT_SUBTREE_DOC): $(GIT_SUBTREE_XML)
43 xmlto -m $(MANPAGE_NORMAL_XSL) man $^
44
45$(GIT_SUBTREE_XML): $(GIT_SUBTREE_TXT)
46 asciidoc -b docbook -d manpage -f $(ASCIIDOC_CONF) \
47 -agit_version=$(gitver) $^
48
49$(GIT_SUBTREE_HTML): $(GIT_SUBTREE_TXT)
50 asciidoc -b xhtml11 -d manpage -f $(ASCIIDOC_CONF) \
51 -agit_version=$(gitver) $^
52
53test:
54 $(MAKE) -C t/ test
55
56clean:
57 rm -f *~ *.xml *.html *.1
58 rm -rf subproj mainline