Show More
@@ -1,44 +1,44 b'' | |||
|
1 | 1 | SOURCES=$(wildcard *.[0-9].txt) |
|
2 | 2 | MAN=$(SOURCES:%.txt=%) |
|
3 | 3 | HTML=$(SOURCES:%.txt=%.html) |
|
4 | 4 | PREFIX=/usr/local |
|
5 | 5 | MANDIR=$(PREFIX)/share/man |
|
6 | 6 | INSTALL=install -c |
|
7 | 7 | |
|
8 | 8 | all: man html |
|
9 | 9 | |
|
10 | 10 | man: $(MAN) |
|
11 | 11 | |
|
12 | 12 | html: $(HTML) |
|
13 | 13 | |
|
14 | 14 | hg.1.txt: hg.1.gendoc.txt |
|
15 | 15 | touch hg.1.txt |
|
16 | 16 | |
|
17 | 17 | hg.1.gendoc.txt: ../mercurial/commands.py ../mercurial/help.py |
|
18 | 18 | python gendoc.py > $@ |
|
19 | 19 | |
|
20 | 20 | %: %.xml |
|
21 | 21 | xmlto man $*.xml |
|
22 | 22 | |
|
23 | 23 | %.xml: %.txt |
|
24 | 24 | asciidoc -d manpage -b docbook $*.txt |
|
25 | 25 | |
|
26 | 26 | %.html: %.txt |
|
27 | 27 | asciidoc -b html4 $*.txt || asciidoc -b html $*.txt |
|
28 | 28 | |
|
29 | 29 | MANIFEST: man html |
|
30 | 30 | # versionned files are already in the main MANIFEST |
|
31 | 31 | $(RM) $@ |
|
32 | 32 | for i in $(MAN) $(HTML) hg.1.gendoc.txt; do \ |
|
33 | 33 | echo "doc/$$i" >> $@ ; \ |
|
34 | 34 | done |
|
35 | 35 | |
|
36 | 36 | install: man |
|
37 | 37 | for i in $(MAN) ; do \ |
|
38 | 38 | subdir=`echo $$i | sed -n 's/..*\.\([0-9]\)$$/man\1/p'` ; \ |
|
39 | mkdir -p $(MANDIR)/$$subdir ; \ | |
|
39 | mkdir -p $(DESTDIR)/$(MANDIR)/$$subdir ; \ | |
|
40 | 40 | $(INSTALL) $$i $(DESTDIR)/$(MANDIR)/$$subdir ; \ |
|
41 | 41 | done |
|
42 | 42 | |
|
43 | 43 | clean: |
|
44 | 44 | $(RM) $(MAN) $(MAN:%=%.xml) $(MAN:%=%.html) *.[0-9].gendoc.txt MANIFEST |
General Comments 0
You need to be logged in to leave comments.
Login now