Show More
@@ -1,50 +1,50 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 -m 644 |
|
7 | 7 | PYTHON=python |
|
8 | 8 | RST2HTML=rst2html |
|
9 | 9 | RST2MAN=rst2man |
|
10 | 10 | |
|
11 | 11 | all: man html |
|
12 | 12 | |
|
13 | 13 | man: $(MAN) |
|
14 | 14 | |
|
15 | 15 | html: $(HTML) |
|
16 | 16 | |
|
17 | 17 | hg.1.txt: hg.1.gendoc.txt |
|
18 | 18 | touch hg.1.txt |
|
19 | 19 | |
|
20 | 20 | hg.1.gendoc.txt: gendoc.py ../mercurial/commands.py ../mercurial/help.py |
|
21 | 21 | ${PYTHON} gendoc.py > $@ |
|
22 | 22 | |
|
23 | 23 | %: %.txt common.txt |
|
24 | 24 | $(RST2MAN) $*.txt > $*.tmp |
|
25 |
|
|
|
25 | # add newline after all literal blocks and fix backslash escape | |
|
26 | 26 | sed \ |
|
27 | 27 | -e 's/^\.fi$$/.fi\n/' \ |
|
28 | 28 | -e 's/\\fB\\\\fP/\\fB\\e\\fP/' \ |
|
29 | 29 | $*.tmp > $* |
|
30 | 30 | rm $*.tmp |
|
31 | 31 | |
|
32 | 32 | %.html: %.txt common.txt |
|
33 | 33 | $(RST2HTML) $*.txt > $*.html |
|
34 | 34 | |
|
35 | 35 | MANIFEST: man html |
|
36 |
|
|
|
36 | # tracked files are already in the main MANIFEST | |
|
37 | 37 | $(RM) $@ |
|
38 | 38 | for i in $(MAN) $(HTML) hg.1.gendoc.txt; do \ |
|
39 | 39 | echo "doc/$$i" >> $@ ; \ |
|
40 | 40 | done |
|
41 | 41 | |
|
42 | 42 | install: man |
|
43 | 43 | for i in $(MAN) ; do \ |
|
44 | 44 | subdir=`echo $$i | sed -n 's/^.*\.\([0-9]\)$$/man\1/p'` ; \ |
|
45 | 45 | mkdir -p $(DESTDIR)$(MANDIR)/$$subdir ; \ |
|
46 | 46 | $(INSTALL) $$i $(DESTDIR)$(MANDIR)/$$subdir ; \ |
|
47 | 47 | done |
|
48 | 48 | |
|
49 | 49 | clean: |
|
50 | 50 | $(RM) $(MAN) $(MAN:%=%.html) *.[0-9].gendoc.txt MANIFEST |
General Comments 0
You need to be logged in to leave comments.
Login now