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