2005-07-11 04:14:06 +04:00
|
|
|
SOURCES=$(wildcard *.[0-9].txt)
|
|
|
|
MAN=$(SOURCES:%.txt=%)
|
|
|
|
HTML=$(SOURCES:%.txt=%.html)
|
2009-12-04 00:37:49 +03:00
|
|
|
GENDOC=gendoc.py ../mercurial/commands.py ../mercurial/help.py ../mercurial/help/*.txt
|
2006-05-09 19:05:49 +04:00
|
|
|
PREFIX=/usr/local
|
2007-01-15 23:30:50 +03:00
|
|
|
MANDIR=$(PREFIX)/share/man
|
2009-01-25 14:21:57 +03:00
|
|
|
INSTALL=install -c -m 644
|
2008-06-24 11:33:13 +04:00
|
|
|
PYTHON=python
|
2009-12-17 01:59:50 +03:00
|
|
|
RST2HTML=$(shell which rst2html 2> /dev/null || echo rst2html.py)
|
2005-06-25 11:15:50 +04:00
|
|
|
|
2009-12-01 02:43:21 +03:00
|
|
|
export LC_ALL=C
|
|
|
|
|
2005-08-22 10:33:02 +04:00
|
|
|
all: man html
|
2005-06-25 11:15:50 +04:00
|
|
|
|
|
|
|
man: $(MAN)
|
|
|
|
|
|
|
|
html: $(HTML)
|
|
|
|
|
2006-02-28 02:48:49 +03:00
|
|
|
hg.1.txt: hg.1.gendoc.txt
|
|
|
|
touch hg.1.txt
|
|
|
|
|
2009-11-02 23:38:42 +03:00
|
|
|
hg.1.gendoc.txt: $(GENDOC)
|
2009-09-13 19:05:38 +04:00
|
|
|
${PYTHON} gendoc.py > $@.tmp
|
|
|
|
mv $@.tmp $@
|
2006-02-28 02:48:49 +03:00
|
|
|
|
2009-07-17 01:25:26 +04:00
|
|
|
%: %.txt common.txt
|
2009-09-13 19:08:31 +04:00
|
|
|
$(PYTHON) rst2man.py --halt warning \
|
|
|
|
--strip-elements-with-class htmlonly $*.txt $*
|
2005-06-25 11:15:50 +04:00
|
|
|
|
2009-07-17 01:25:26 +04:00
|
|
|
%.html: %.txt common.txt
|
2009-10-22 01:40:01 +04:00
|
|
|
$(RST2HTML) --halt warning \
|
|
|
|
--link-stylesheet --stylesheet-path style.css $*.txt $*.html
|
2005-06-25 11:15:50 +04:00
|
|
|
|
2006-12-12 13:39:05 +03:00
|
|
|
MANIFEST: man html
|
2009-08-21 01:35:47 +04:00
|
|
|
# tracked files are already in the main MANIFEST
|
2006-12-12 13:39:05 +03:00
|
|
|
$(RM) $@
|
2006-12-16 15:57:37 +03:00
|
|
|
for i in $(MAN) $(HTML) hg.1.gendoc.txt; do \
|
2006-12-12 13:39:05 +03:00
|
|
|
echo "doc/$$i" >> $@ ; \
|
|
|
|
done
|
|
|
|
|
2006-05-09 19:05:49 +04:00
|
|
|
install: man
|
|
|
|
for i in $(MAN) ; do \
|
2009-06-10 21:59:44 +04:00
|
|
|
subdir=`echo $$i | sed -n 's/^.*\.\([0-9]\)$$/man\1/p'` ; \
|
2007-07-08 14:58:19 +04:00
|
|
|
mkdir -p $(DESTDIR)$(MANDIR)/$$subdir ; \
|
|
|
|
$(INSTALL) $$i $(DESTDIR)$(MANDIR)/$$subdir ; \
|
2006-05-09 19:05:49 +04:00
|
|
|
done
|
|
|
|
|
2005-06-25 11:15:50 +04:00
|
|
|
clean:
|
2009-07-17 01:25:26 +04:00
|
|
|
$(RM) $(MAN) $(MAN:%=%.html) *.[0-9].gendoc.txt MANIFEST
|