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