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