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