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