Mercurial > hg
annotate doc/Makefile @ 3881:59ec9c38f614
merge with crew
author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
---|---|
date | Thu, 14 Dec 2006 13:30:47 +0100 |
parents | 9d7ac8613340 |
children | 39dcee009aab |
rev | line source |
---|---|
671
efa4a7e2f322
Move hgrc documentation out to its own man page, hgrc(5).
Bryan O'Sullivan <bos@serpentine.com>
parents:
465
diff
changeset
|
1 SOURCES=$(wildcard *.[0-9].txt) |
efa4a7e2f322
Move hgrc documentation out to its own man page, hgrc(5).
Bryan O'Sullivan <bos@serpentine.com>
parents:
465
diff
changeset
|
2 MAN=$(SOURCES:%.txt=%) |
efa4a7e2f322
Move hgrc documentation out to its own man page, hgrc(5).
Bryan O'Sullivan <bos@serpentine.com>
parents:
465
diff
changeset
|
3 HTML=$(SOURCES:%.txt=%.html) |
2233 | 4 PREFIX=/usr/local |
5 MANDIR=$(PREFIX)/man | |
6 INSTALL=install -c | |
465 | 7 |
1006
b0e581438835
Generate html documentation by default, too.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
671
diff
changeset
|
8 all: man html |
465 | 9 |
10 man: $(MAN) | |
11 | |
12 html: $(HTML) | |
13 | |
1814
7956893e8458
generate hg manpage from commands.py docstring
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
1689
diff
changeset
|
14 hg.1.txt: hg.1.gendoc.txt |
7956893e8458
generate hg manpage from commands.py docstring
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
1689
diff
changeset
|
15 touch hg.1.txt |
7956893e8458
generate hg manpage from commands.py docstring
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
1689
diff
changeset
|
16 |
1819
d657bfdc06c4
Regenerate hg.1.gendoc.txt if commands.py changed.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1814
diff
changeset
|
17 hg.1.gendoc.txt: ../mercurial/commands.py |
1814
7956893e8458
generate hg manpage from commands.py docstring
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
1689
diff
changeset
|
18 python gendoc.py > $@ |
7956893e8458
generate hg manpage from commands.py docstring
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
1689
diff
changeset
|
19 |
671
efa4a7e2f322
Move hgrc documentation out to its own man page, hgrc(5).
Bryan O'Sullivan <bos@serpentine.com>
parents:
465
diff
changeset
|
20 %: %.xml |
efa4a7e2f322
Move hgrc documentation out to its own man page, hgrc(5).
Bryan O'Sullivan <bos@serpentine.com>
parents:
465
diff
changeset
|
21 xmlto man $*.xml |
465 | 22 |
671
efa4a7e2f322
Move hgrc documentation out to its own man page, hgrc(5).
Bryan O'Sullivan <bos@serpentine.com>
parents:
465
diff
changeset
|
23 %.xml: %.txt |
efa4a7e2f322
Move hgrc documentation out to its own man page, hgrc(5).
Bryan O'Sullivan <bos@serpentine.com>
parents:
465
diff
changeset
|
24 asciidoc -d manpage -b docbook $*.txt |
465 | 25 |
671
efa4a7e2f322
Move hgrc documentation out to its own man page, hgrc(5).
Bryan O'Sullivan <bos@serpentine.com>
parents:
465
diff
changeset
|
26 %.html: %.txt |
1689
c6c76ead1cc1
Fall back to asciidoc6 html backend if html4 doesn't work.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
1428
diff
changeset
|
27 asciidoc -b html4 $*.txt || asciidoc -b html $*.txt |
465 | 28 |
3872
9d7ac8613340
fix MANIFEST generation
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
3269
diff
changeset
|
29 MANIFEST: man html |
9d7ac8613340
fix MANIFEST generation
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
3269
diff
changeset
|
30 # versionned files are already in the main MANIFEST |
9d7ac8613340
fix MANIFEST generation
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
3269
diff
changeset
|
31 $(RM) $@ |
9d7ac8613340
fix MANIFEST generation
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
3269
diff
changeset
|
32 for i in $(MAN) $(HTML); do \ |
9d7ac8613340
fix MANIFEST generation
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
3269
diff
changeset
|
33 echo "doc/$$i" >> $@ ; \ |
9d7ac8613340
fix MANIFEST generation
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
3269
diff
changeset
|
34 done |
9d7ac8613340
fix MANIFEST generation
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
3269
diff
changeset
|
35 |
2233 | 36 install: man |
37 for i in $(MAN) ; do \ | |
3269
6901d3545021
Some versions of sed don't support .\+, so use ..* instead.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
3245
diff
changeset
|
38 subdir=`echo $$i | sed -n 's/..*\.\([0-9]\)$$/man\1/p'` ; \ |
2233 | 39 mkdir -p $(MANDIR)/$$subdir ; \ |
40 $(INSTALL) $$i $(MANDIR)/$$subdir ; \ | |
41 done | |
42 | |
465 | 43 clean: |
3872
9d7ac8613340
fix MANIFEST generation
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
3269
diff
changeset
|
44 $(RM) $(MAN) $(MAN:%=%.xml) $(MAN:%=%.html) *.[0-9].gendoc.txt MANIFEST |