2013-07-03 16:49:43 +04:00
|
|
|
SOURCES=$(notdir $(wildcard ../mercurial/help/*.[0-9].txt))
|
2005-07-11 04:14:06 +04:00
|
|
|
MAN=$(SOURCES:%.txt=%)
|
|
|
|
HTML=$(SOURCES:%.txt=%.html)
|
2010-11-04 19:52:40 +03:00
|
|
|
GENDOC=gendoc.py ../mercurial/commands.py ../mercurial/help.py \
|
|
|
|
../mercurial/help/*.txt ../hgext/*.py ../hgext/*/__init__.py
|
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
|
2010-12-01 03:46:11 +03:00
|
|
|
RSTARGS=
|
2005-06-25 11:15:50 +04:00
|
|
|
|
2013-07-03 16:50:20 +04:00
|
|
|
export HGENCODING=UTF-8
|
2009-12-01 02:43:21 +03:00
|
|
|
|
2005-08-22 10:33:02 +04:00
|
|
|
all: man html
|
2005-06-25 11:15:50 +04:00
|
|
|
|
|
|
|
man: $(MAN)
|
|
|
|
|
|
|
|
html: $(HTML)
|
|
|
|
|
2013-07-03 16:49:43 +04:00
|
|
|
common.txt $(SOURCES) $(SOURCES:%.txt=%.gendoc.txt): $(GENDOC)
|
2017-10-11 02:19:48 +03:00
|
|
|
${PYTHON} gendoc.py "$(basename $@)" > $@.tmp
|
2009-09-13 19:05:38 +04:00
|
|
|
mv $@.tmp $@
|
2006-02-28 02:48:49 +03:00
|
|
|
|
2013-07-03 16:49:43 +04:00
|
|
|
%: %.txt %.gendoc.txt common.txt
|
2010-12-01 03:46:11 +03:00
|
|
|
$(PYTHON) runrst hgmanpage $(RSTARGS) --halt warning \
|
2009-09-13 19:08:31 +04:00
|
|
|
--strip-elements-with-class htmlonly $*.txt $*
|
2005-06-25 11:15:50 +04:00
|
|
|
|
2013-07-03 16:49:43 +04:00
|
|
|
%.html: %.txt %.gendoc.txt common.txt
|
2010-12-01 03:46:11 +03:00
|
|
|
$(PYTHON) runrst html $(RSTARGS) --halt warning \
|
2009-10-22 01:40:01 +04:00
|
|
|
--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) $@
|
2010-10-23 22:10:18 +04:00
|
|
|
for i in $(MAN) $(HTML); 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'` ; \
|
2017-10-11 02:19:48 +03: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:
|
2013-07-03 16:49:43 +04:00
|
|
|
$(RM) $(MAN) $(HTML) common.txt $(SOURCES) $(SOURCES:%.txt=%.gendoc.txt) MANIFEST
|