Show More
@@ -1,48 +1,48 b'' | |||||
1 | SOURCES=$(wildcard *.[0-9].txt) |
|
1 | SOURCES=$(wildcard *.[0-9].txt) | |
2 | MAN=$(SOURCES:%.txt=%) |
|
2 | MAN=$(SOURCES:%.txt=%) | |
3 | HTML=$(SOURCES:%.txt=%.html) |
|
3 | HTML=$(SOURCES:%.txt=%.html) | |
4 | PREFIX=/usr/local |
|
4 | PREFIX=/usr/local | |
5 | MANDIR=$(PREFIX)/share/man |
|
5 | MANDIR=$(PREFIX)/share/man | |
6 | INSTALL=install -c -m 644 |
|
6 | INSTALL=install -c -m 644 | |
7 | PYTHON=python |
|
7 | PYTHON=python | |
8 | ASCIIDOC=asciidoc |
|
8 | ASCIIDOC=asciidoc | |
9 |
|
9 | |||
10 | all: man html |
|
10 | all: man html | |
11 |
|
11 | |||
12 | man: $(MAN) |
|
12 | man: $(MAN) | |
13 |
|
13 | |||
14 | html: $(HTML) |
|
14 | html: $(HTML) | |
15 |
|
15 | |||
16 | hg.1.txt: hg.1.gendoc.txt |
|
16 | hg.1.txt: hg.1.gendoc.txt | |
17 | touch hg.1.txt |
|
17 | touch hg.1.txt | |
18 |
|
18 | |||
19 | hg.1.gendoc.txt: ../mercurial/commands.py ../mercurial/help.py |
|
19 | hg.1.gendoc.txt: ../mercurial/commands.py ../mercurial/help.py | |
20 | ${PYTHON} gendoc.py > $@ |
|
20 | ${PYTHON} gendoc.py > $@ | |
21 |
|
21 | |||
22 | %: %.xml |
|
22 | %: %.xml | |
23 | xmlto man $*.xml && \ |
|
23 | xmlto man $*.xml && \ | |
24 | sed -e 's/^\.hg/\\\&.hg/' $* > $*~ && \ |
|
24 | sed -e 's/^\.hg/\\\&.hg/' $* > $*~ && \ | |
25 | mv $*~ $* |
|
25 | mv $*~ $* | |
26 |
|
26 | |||
27 | %.xml: %.txt |
|
27 | %.xml: %.txt | |
28 | $(ASCIIDOC) -d manpage -b docbook $*.txt |
|
28 | $(ASCIIDOC) -d manpage -b docbook $*.txt | |
29 |
|
29 | |||
30 | %.html: %.txt |
|
30 | %.html: %.txt | |
31 | $(ASCIIDOC) -b html4 $*.txt || $(ASCIIDOC) -b html $*.txt |
|
31 | $(ASCIIDOC) -b html4 $*.txt || $(ASCIIDOC) -b html $*.txt | |
32 |
|
32 | |||
33 | MANIFEST: man html |
|
33 | MANIFEST: man html | |
34 | # tracked files are already in the main MANIFEST |
|
34 | # tracked files are already in the main MANIFEST | |
35 | $(RM) $@ |
|
35 | $(RM) $@ | |
36 | for i in $(MAN) $(HTML) hg.1.gendoc.txt; do \ |
|
36 | for i in $(MAN) $(HTML) hg.1.gendoc.txt; do \ | |
37 | echo "doc/$$i" >> $@ ; \ |
|
37 | echo "doc/$$i" >> $@ ; \ | |
38 | done |
|
38 | done | |
39 |
|
39 | |||
40 | install: man |
|
40 | install: man | |
41 | for i in $(MAN) ; do \ |
|
41 | for i in $(MAN) ; do \ | |
42 |
subdir=`echo $$i | sed -n 's/ |
|
42 | subdir=`echo $$i | sed -n 's/^.*\.\([0-9]\)$$/man\1/p'` ; \ | |
43 | mkdir -p $(DESTDIR)$(MANDIR)/$$subdir ; \ |
|
43 | mkdir -p $(DESTDIR)$(MANDIR)/$$subdir ; \ | |
44 | $(INSTALL) $$i $(DESTDIR)$(MANDIR)/$$subdir ; \ |
|
44 | $(INSTALL) $$i $(DESTDIR)$(MANDIR)/$$subdir ; \ | |
45 | done |
|
45 | done | |
46 |
|
46 | |||
47 | clean: |
|
47 | clean: | |
48 | $(RM) $(MAN) $(MAN:%=%.xml) $(MAN:%=%.html) *.[0-9].gendoc.txt MANIFEST |
|
48 | $(RM) $(MAN) $(MAN:%=%.xml) $(MAN:%=%.html) *.[0-9].gendoc.txt MANIFEST |
General Comments 0
You need to be logged in to leave comments.
Login now