Makefile
55 lines
| 1.2 KiB
| text/x-makefile
|
MakefileLexer
/ doc / Makefile
|
r671 | SOURCES=$(wildcard *.[0-9].txt) | ||
MAN=$(SOURCES:%.txt=%) | ||||
HTML=$(SOURCES:%.txt=%.html) | ||||
|
r12921 | GENDOC=gendoc.py ../mercurial/commands.py ../mercurial/help.py \ | ||
../mercurial/help/*.txt ../hgext/*.py ../hgext/*/__init__.py | ||||
|
r2233 | PREFIX=/usr/local | ||
|
r4030 | MANDIR=$(PREFIX)/share/man | ||
|
r7686 | INSTALL=install -c -m 644 | ||
|
r6724 | PYTHON=python | ||
|
r13054 | RSTARGS= | ||
|
r465 | |||
|
r10555 | export LANGUAGE=C | ||
|
r9971 | export LC_ALL=C | ||
|
r1006 | all: man html | ||
|
r465 | |||
man: $(MAN) | ||||
html: $(HTML) | ||||
|
r1814 | hg.1.txt: hg.1.gendoc.txt | ||
touch hg.1.txt | ||||
|
r9703 | hg.1.gendoc.txt: $(GENDOC) | ||
|
r9444 | ${PYTHON} gendoc.py > $@.tmp | ||
mv $@.tmp $@ | ||||
|
r1814 | |||
|
r14459 | hgrc.5: ../mercurial/help/config.txt | ||
hgrc.5.html: ../mercurial/help/config.txt | ||||
|
r9162 | %: %.txt common.txt | ||
|
r13054 | $(PYTHON) runrst hgmanpage $(RSTARGS) --halt warning \ | ||
|
r9445 | --strip-elements-with-class htmlonly $*.txt $* | ||
|
r465 | |||
|
r9162 | %.html: %.txt common.txt | ||
|
r13054 | $(PYTHON) runrst html $(RSTARGS) --halt warning \ | ||
|
r9626 | --link-stylesheet --stylesheet-path style.css $*.txt $*.html | ||
|
r465 | |||
|
r3872 | MANIFEST: man html | ||
|
r9401 | # tracked files are already in the main MANIFEST | ||
|
r3872 | $(RM) $@ | ||
|
r12841 | for i in $(MAN) $(HTML); do \ | ||
|
r3872 | echo "doc/$$i" >> $@ ; \ | ||
done | ||||
|
r2233 | install: man | ||
for i in $(MAN) ; do \ | ||||
|
r8822 | subdir=`echo $$i | sed -n 's/^.*\.\([0-9]\)$$/man\1/p'` ; \ | ||
|
r4753 | mkdir -p $(DESTDIR)$(MANDIR)/$$subdir ; \ | ||
$(INSTALL) $$i $(DESTDIR)$(MANDIR)/$$subdir ; \ | ||||
|
r2233 | done | ||
|
r465 | clean: | ||
|
r12840 | $(RM) $(MAN) $(HTML) hg.1.gendoc.txt MANIFEST | ||