|
3 | 3 |
|
4 | 4 | prefix ?= /usr/local
|
5 | 5 | mandir ?= $(prefix)/share/man
|
| 6 | +libexecdir ?= $(prefix)/libexec/git-core |
6 | 7 | gitdir ?= $(shell git --exec-path)
|
| 8 | +man1dir ?= $(mandir)/man1 |
7 | 9 |
|
8 | 10 | gitver ?= $(word 3,$(shell git --version))
|
9 | 11 |
|
10 | 12 | # this should be set to a 'standard' bsd-type install program
|
11 | 13 | INSTALL ?= install
|
12 |
| -INSTALL_DATA = $(INSTALL) -c -m 0644 |
13 |
| -INSTALL_EXE = $(INSTALL) -c -m 0755 |
14 |
| -INSTALL_DIR = $(INSTALL) -c -d -m 0755 |
15 | 14 |
|
16 | 15 | ASCIIDOC_CONF = ../../Documentation/asciidoc.conf
|
17 | 16 | MANPAGE_NORMAL_XSL = ../../Documentation/manpage-normal.xsl
|
18 | 17 |
|
19 |
| -default: |
20 |
| - @echo "git-subtree doesn't need to be built." |
21 |
| - @echo "Just copy it somewhere on your PATH, like /usr/local/bin." |
22 |
| - @echo |
23 |
| - @echo "Try: make doc" |
24 |
| - @echo " or: make test" |
25 |
| - @false |
| 18 | +GIT_SUBTREE_SH := git-subtree.sh |
| 19 | +GIT_SUBTREE := git-subtree |
26 | 20 |
|
27 |
| -install: install-exe install-doc |
| 21 | +GIT_SUBTREE_DOC := git-subtree.1 |
| 22 | +GIT_SUBTREE_XML := git-subtree.xml |
| 23 | +GIT_SUBTREE_TXT := git-subtree.txt |
28 | 24 |
|
29 |
| -install-exe: git-subtree.sh |
30 |
| - $(INSTALL_DIR) $(DESTDIR)/$(gitdir) |
31 |
| - $(INSTALL_EXE) $< $(DESTDIR)/$(gitdir)/git-subtree |
| 25 | +all: $(GIT_SUBTREE) |
32 | 26 |
|
33 |
| -install-doc: git-subtree.1 |
34 |
| - $(INSTALL_DIR) $(DESTDIR)/$(mandir)/man1/ |
35 |
| - $(INSTALL_DATA) $< $(DESTDIR)/$(mandir)/man1/ |
| 27 | +$(GIT_SUBTREE): $(GIT_SUBTREE_SH) |
| 28 | + cp $< $@ && chmod +x $@ |
36 | 29 |
|
37 |
| -doc: git-subtree.1 |
| 30 | +doc: $(GIT_SUBTREE_DOC) |
38 | 31 |
|
39 |
| -%.1: %.xml |
| 32 | +install: $(GIT_SUBTREE) |
| 33 | + $(INSTALL) -m 755 $(GIT_SUBTREE) $(libexecdir) |
| 34 | + |
| 35 | +install-doc: install-man |
| 36 | + |
| 37 | +install-man: $(GIT_SUBTREE_DOC) |
| 38 | + $(INSTALL) -m 644 $^ $(man1dir) |
| 39 | + |
| 40 | +$(GIT_SUBTREE_DOC): $(GIT_SUBTREE_XML) |
40 | 41 | xmlto -m $(MANPAGE_NORMAL_XSL) man $^
|
41 | 42 |
|
42 |
| -%.xml: %.txt |
| 43 | +$(GIT_SUBTREE_XML): $(GIT_SUBTREE_TXT) |
43 | 44 | asciidoc -b docbook -d manpage -f $(ASCIIDOC_CONF) \
|
44 | 45 | -agit_version=$(gitver) $^
|
45 | 46 |
|
|
0 commit comments