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