rebase: teach rebase --keep-base
[git/git.git] / contrib / subtree / Makefile
CommitLineData
960160b0
JK
1# The default target of this Makefile is...
2all::
3
187bc2da
DG
4-include ../../config.mak.autogen
5-include ../../config.mak
6
634392b2 7prefix ?= /usr/local
2c45009b 8gitexecdir ?= $(prefix)/libexec/git-core
4d24d520 9mandir ?= $(prefix)/share/man
7ff8463d 10man1dir ?= $(mandir)/man1
4d24d520 11htmldir ?= $(prefix)/share/doc/git-doc
634392b2 12
8e2a5cca
JD
13../../GIT-VERSION-FILE: FORCE
14 $(MAKE) -C ../../ GIT-VERSION-FILE
15
16-include ../../GIT-VERSION-FILE
634392b2
DG
17
18# this should be set to a 'standard' bsd-type install program
602efc4f
JD
19INSTALL ?= install
20RM ?= rm -f
634392b2 21
fdc1ad97
W
22ASCIIDOC = asciidoc
23ASCIIDOC_CONF = -f ../../Documentation/asciidoc.conf
24ASCIIDOC_HTML = xhtml11
25ASCIIDOC_DOCBOOK = docbook
26ASCIIDOC_EXTRA =
27XMLTO = xmlto
28
29ifdef USE_ASCIIDOCTOR
30ASCIIDOC = asciidoctor
31ASCIIDOC_CONF =
32ASCIIDOC_HTML = xhtml5
33ASCIIDOC_DOCBOOK = docbook45
34ASCIIDOC_EXTRA += -I../../Documentation -rasciidoctor-extensions
35ASCIIDOC_EXTRA += -alitdd='&\#x2d;&\#x2d;'
36endif
c7abbb98 37
da33a979
CB
38ifndef SHELL_PATH
39 SHELL_PATH = /bin/sh
40endif
41SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
42
c7abbb98 43MANPAGE_XSL = ../../Documentation/manpage-normal.xsl
5163d476 44
7ff8463d
DG
45GIT_SUBTREE_SH := git-subtree.sh
46GIT_SUBTREE := git-subtree
634392b2 47
7ff8463d
DG
48GIT_SUBTREE_DOC := git-subtree.1
49GIT_SUBTREE_XML := git-subtree.xml
50GIT_SUBTREE_TXT := git-subtree.txt
95c62fb9 51GIT_SUBTREE_HTML := git-subtree.html
43cce5c8 52GIT_SUBTREE_TEST := ../../git-subtree
634392b2 53
960160b0 54all:: $(GIT_SUBTREE)
634392b2 55
7ff8463d 56$(GIT_SUBTREE): $(GIT_SUBTREE_SH)
da33a979
CB
57 sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' $< >$@
58 chmod +x $@
634392b2 59
95c62fb9 60doc: $(GIT_SUBTREE_DOC) $(GIT_SUBTREE_HTML)
634392b2 61
0f952b26
CH
62man: $(GIT_SUBTREE_DOC)
63
64html: $(GIT_SUBTREE_HTML)
65
7ff8463d 66install: $(GIT_SUBTREE)
2c45009b
JD
67 $(INSTALL) -d -m 755 $(DESTDIR)$(gitexecdir)
68 $(INSTALL) -m 755 $(GIT_SUBTREE) $(DESTDIR)$(gitexecdir)
7ff8463d 69
4d24d520 70install-doc: install-man install-html
7ff8463d 71
0df8e6d5 72install-man: $(GIT_SUBTREE_DOC)
8165be06 73 $(INSTALL) -d -m 755 $(DESTDIR)$(man1dir)
d8684822 74 $(INSTALL) -m 644 $^ $(DESTDIR)$(man1dir)
7ff8463d 75
0df8e6d5 76install-html: $(GIT_SUBTREE_HTML)
4d24d520
SS
77 $(INSTALL) -d -m 755 $(DESTDIR)$(htmldir)
78 $(INSTALL) -m 644 $^ $(DESTDIR)$(htmldir)
79
7ff8463d 80$(GIT_SUBTREE_DOC): $(GIT_SUBTREE_XML)
c7abbb98 81 $(XMLTO) -m $(MANPAGE_XSL) man $^
634392b2 82
7ff8463d 83$(GIT_SUBTREE_XML): $(GIT_SUBTREE_TXT)
fdc1ad97
W
84 $(ASCIIDOC) -b $(ASCIIDOC_DOCBOOK) -d manpage $(ASCIIDOC_CONF) \
85 -agit_version=$(GIT_VERSION) $(ASCIIDOC_EXTRA) $^
5163d476 86
95c62fb9 87$(GIT_SUBTREE_HTML): $(GIT_SUBTREE_TXT)
fdc1ad97
W
88 $(ASCIIDOC) -b $(ASCIIDOC_HTML) -d manpage $(ASCIIDOC_CONF) \
89 -agit_version=$(GIT_VERSION) $(ASCIIDOC_EXTRA) $^
95c62fb9 90
43cce5c8
DG
91$(GIT_SUBTREE_TEST): $(GIT_SUBTREE)
92 cp $< $@
93
94test: $(GIT_SUBTREE_TEST)
311391da 95 $(MAKE) -C t/ test
634392b2
DG
96
97clean:
602efc4f
JD
98 $(RM) $(GIT_SUBTREE)
99 $(RM) *.xml *.html *.1
8e2a5cca 100
0df8e6d5 101.PHONY: FORCE