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 | GENDOC=gendoc.py ../mercurial/commands.py ../mercurial/help.py ../help/*.txt | |||
4 | PREFIX=/usr/local |
|
5 | PREFIX=/usr/local | |
5 | MANDIR=$(PREFIX)/share/man |
|
6 | MANDIR=$(PREFIX)/share/man | |
6 | INSTALL=install -c -m 644 |
|
7 | INSTALL=install -c -m 644 | |
7 | PYTHON=python |
|
8 | PYTHON=python | |
8 | RST2HTML=$(shell which rst2html 2> /dev/null || which rst2html.py) |
|
9 | RST2HTML=$(shell which rst2html 2> /dev/null || which rst2html.py) | |
9 |
|
10 | |||
10 | all: man html |
|
11 | all: man html | |
11 |
|
12 | |||
12 | man: $(MAN) |
|
13 | man: $(MAN) | |
13 |
|
14 | |||
14 | html: $(HTML) |
|
15 | html: $(HTML) | |
15 |
|
16 | |||
16 | hg.1.txt: hg.1.gendoc.txt |
|
17 | hg.1.txt: hg.1.gendoc.txt | |
17 | touch hg.1.txt |
|
18 | touch hg.1.txt | |
18 |
|
19 | |||
19 | hg.1.gendoc.txt: gendoc.py ../mercurial/commands.py ../mercurial/help.py |
|
20 | hg.1.gendoc.txt: $(GENDOC) | |
20 | ${PYTHON} gendoc.py > $@.tmp |
|
21 | ${PYTHON} gendoc.py > $@.tmp | |
21 | mv $@.tmp $@ |
|
22 | mv $@.tmp $@ | |
22 |
|
23 | |||
23 | %: %.txt common.txt |
|
24 | %: %.txt common.txt | |
24 | $(PYTHON) rst2man.py --halt warning \ |
|
25 | $(PYTHON) rst2man.py --halt warning \ | |
25 | --strip-elements-with-class htmlonly $*.txt $* |
|
26 | --strip-elements-with-class htmlonly $*.txt $* | |
26 |
|
27 | |||
27 | %.html: %.txt common.txt |
|
28 | %.html: %.txt common.txt | |
28 | $(RST2HTML) --halt warning \ |
|
29 | $(RST2HTML) --halt warning \ | |
29 | --link-stylesheet --stylesheet-path style.css $*.txt $*.html |
|
30 | --link-stylesheet --stylesheet-path style.css $*.txt $*.html | |
30 |
|
31 | |||
31 | MANIFEST: man html |
|
32 | MANIFEST: man html | |
32 | # tracked files are already in the main MANIFEST |
|
33 | # tracked 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:%=%.html) *.[0-9].gendoc.txt MANIFEST |
|
47 | $(RM) $(MAN) $(MAN:%=%.html) *.[0-9].gendoc.txt MANIFEST |
General Comments 0
You need to be logged in to leave comments.
Login now