Show More
@@ -1,49 +1,49 | |||||
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 ../mercurial/help/*.txt |
|
4 | GENDOC=gendoc.py ../mercurial/commands.py ../mercurial/help.py ../mercurial/help/*.txt | |
5 | PREFIX=/usr/local |
|
5 | PREFIX=/usr/local | |
6 | MANDIR=$(PREFIX)/share/man |
|
6 | MANDIR=$(PREFIX)/share/man | |
7 | INSTALL=install -c -m 644 |
|
7 | INSTALL=install -c -m 644 | |
8 | PYTHON=python |
|
8 | PYTHON=python | |
9 |
RST2HTML=$(shell which rst2html 2> /dev/null || |
|
9 | RST2HTML=$(shell which rst2html 2> /dev/null || echo rst2html.py) | |
10 |
|
10 | |||
11 | export LC_ALL=C |
|
11 | export LC_ALL=C | |
12 |
|
12 | |||
13 | all: man html |
|
13 | all: man html | |
14 |
|
14 | |||
15 | man: $(MAN) |
|
15 | man: $(MAN) | |
16 |
|
16 | |||
17 | html: $(HTML) |
|
17 | html: $(HTML) | |
18 |
|
18 | |||
19 | hg.1.txt: hg.1.gendoc.txt |
|
19 | hg.1.txt: hg.1.gendoc.txt | |
20 | touch hg.1.txt |
|
20 | touch hg.1.txt | |
21 |
|
21 | |||
22 | hg.1.gendoc.txt: $(GENDOC) |
|
22 | hg.1.gendoc.txt: $(GENDOC) | |
23 | ${PYTHON} gendoc.py > $@.tmp |
|
23 | ${PYTHON} gendoc.py > $@.tmp | |
24 | mv $@.tmp $@ |
|
24 | mv $@.tmp $@ | |
25 |
|
25 | |||
26 | %: %.txt common.txt |
|
26 | %: %.txt common.txt | |
27 | $(PYTHON) rst2man.py --halt warning \ |
|
27 | $(PYTHON) rst2man.py --halt warning \ | |
28 | --strip-elements-with-class htmlonly $*.txt $* |
|
28 | --strip-elements-with-class htmlonly $*.txt $* | |
29 |
|
29 | |||
30 | %.html: %.txt common.txt |
|
30 | %.html: %.txt common.txt | |
31 | $(RST2HTML) --halt warning \ |
|
31 | $(RST2HTML) --halt warning \ | |
32 | --link-stylesheet --stylesheet-path style.css $*.txt $*.html |
|
32 | --link-stylesheet --stylesheet-path style.css $*.txt $*.html | |
33 |
|
33 | |||
34 | MANIFEST: man html |
|
34 | MANIFEST: man html | |
35 | # tracked files are already in the main MANIFEST |
|
35 | # tracked files are already in the main MANIFEST | |
36 | $(RM) $@ |
|
36 | $(RM) $@ | |
37 | for i in $(MAN) $(HTML) hg.1.gendoc.txt; do \ |
|
37 | for i in $(MAN) $(HTML) hg.1.gendoc.txt; do \ | |
38 | echo "doc/$$i" >> $@ ; \ |
|
38 | echo "doc/$$i" >> $@ ; \ | |
39 | done |
|
39 | done | |
40 |
|
40 | |||
41 | install: man |
|
41 | install: man | |
42 | for i in $(MAN) ; do \ |
|
42 | for i in $(MAN) ; do \ | |
43 | subdir=`echo $$i | sed -n 's/^.*\.\([0-9]\)$$/man\1/p'` ; \ |
|
43 | subdir=`echo $$i | sed -n 's/^.*\.\([0-9]\)$$/man\1/p'` ; \ | |
44 | mkdir -p $(DESTDIR)$(MANDIR)/$$subdir ; \ |
|
44 | mkdir -p $(DESTDIR)$(MANDIR)/$$subdir ; \ | |
45 | $(INSTALL) $$i $(DESTDIR)$(MANDIR)/$$subdir ; \ |
|
45 | $(INSTALL) $$i $(DESTDIR)$(MANDIR)/$$subdir ; \ | |
46 | done |
|
46 | done | |
47 |
|
47 | |||
48 | clean: |
|
48 | clean: | |
49 | $(RM) $(MAN) $(MAN:%=%.html) *.[0-9].gendoc.txt MANIFEST |
|
49 | $(RM) $(MAN) $(MAN:%=%.html) *.[0-9].gendoc.txt MANIFEST |
General Comments 0
You need to be logged in to leave comments.
Login now