2012-05-11 19:07:44 -04:00
|
|
|
# ease.js manual Makefile
|
|
|
|
#
|
|
|
|
# Responsible for building the project documentation.
|
|
|
|
#
|
2014-04-09 18:59:22 -04:00
|
|
|
# Copyright (C) 2010, 2011, 2012, 2013, 2014 Free Software Foundation, Inc.
|
2012-05-11 19:07:44 -04:00
|
|
|
#
|
2013-12-22 09:37:21 -05:00
|
|
|
# This file is part of GNU ease.js.
|
2012-05-11 19:07:44 -04:00
|
|
|
#
|
|
|
|
# This program is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
##
|
2011-06-05 11:58:33 -04:00
|
|
|
|
2013-12-21 23:58:02 -05:00
|
|
|
info_TEXINFOS = easejs.texi
|
2014-04-26 11:09:21 -04:00
|
|
|
easejs_TEXINFOS = license.texi about.texi classes.texi interop.texi \
|
2013-12-21 23:31:45 -05:00
|
|
|
impl-details.texi integration.texi mkeywords.texi source-tree.texi
|
2013-12-21 23:58:02 -05:00
|
|
|
|
2013-12-22 01:03:02 -05:00
|
|
|
EXTRA_DIST = img README highlight.pack.js interactive.js easejs.css
|
2013-12-21 23:31:45 -05:00
|
|
|
|
2011-06-05 11:58:33 -04:00
|
|
|
path_build=../build
|
|
|
|
path_lib=../lib
|
2013-12-21 23:31:45 -05:00
|
|
|
docdir = @docdir@
|
2013-12-24 23:50:24 -05:00
|
|
|
path_doc_output_plain=easejs.txt
|
|
|
|
path_doc_output_html=easejs.html
|
|
|
|
path_doc_output_html1=easejs-single.html
|
|
|
|
path_doc_css=easejs.css
|
|
|
|
path_doc_img=img
|
|
|
|
path_easejs_texi=easejs.texi
|
|
|
|
path_doc_css_ref=$(path_doc_css)
|
|
|
|
|
|
|
|
MAKEINFOHTML=$(MAKEINFO) --html --css-ref="$(path_doc_css_ref)"
|
|
|
|
|
2015-12-22 11:45:13 -05:00
|
|
|
doc_src := $(wildcard *.texi)
|
|
|
|
doc_imgs := $(patsubst %.dia, %.png, $(wildcard $(path_doc_img)/*.dia))
|
|
|
|
doc_imgs_eps := $(patsubst %.dia, %.eps, $(wildcard $(path_doc_img)/*.dia))
|
2011-06-05 11:58:33 -04:00
|
|
|
doc_imgs_txt := $(patsubst %.dia, %.png, $(wildcard $(path_doc_img)/*.txt))
|
|
|
|
|
|
|
|
doc_replace := s/<\/body>/<script type="text\/javascript" \
|
|
|
|
src="highlight.pack.js"><\/script><script type="text\/javascript" \
|
2011-11-15 23:24:19 -05:00
|
|
|
src="interactive.js"><\/script><\/body>/\
|
|
|
|
;s/\>\;=/\&\#8805\;/g\
|
2013-12-21 23:31:45 -05:00
|
|
|
;s/\<\;=/\&\#8804\;/g
|
2011-06-05 11:58:33 -04:00
|
|
|
|
2013-12-24 23:50:24 -05:00
|
|
|
.PHONY: doc mkbuild-doc img info html
|
2011-06-05 11:58:33 -04:00
|
|
|
|
|
|
|
mkbuild-doc: $(path_doc_output)
|
|
|
|
|
2013-12-24 23:50:24 -05:00
|
|
|
dvi-local: img
|
|
|
|
pdf-local: img
|
|
|
|
html-local: img easejs.css highlight.pack.js interactive.js
|
2011-06-05 11:58:33 -04:00
|
|
|
|
|
|
|
# doc images
|
2015-12-22 22:52:04 -05:00
|
|
|
if HAS_DIA
|
2013-12-24 23:50:24 -05:00
|
|
|
img/%.png: img/%.dia
|
2011-11-27 11:56:19 -05:00
|
|
|
echo "$<" | grep -q 'wide' \
|
2015-12-22 22:52:04 -05:00
|
|
|
&& $(DIA) -e $@ -s x250 $< \
|
|
|
|
|| $(DIA) -e $@ -s 300x $<
|
|
|
|
else
|
|
|
|
@echo "warning: not building eps (--without-dia)"
|
|
|
|
endif
|
2011-06-05 11:58:33 -04:00
|
|
|
|
2015-12-22 11:45:13 -05:00
|
|
|
img/%.eps: img/%.dia
|
2015-12-22 22:52:04 -05:00
|
|
|
if HAS_DIA
|
|
|
|
$(DIA) -e $@ $<
|
|
|
|
else
|
|
|
|
@echo "warning: not building eps (--without-dia)"
|
|
|
|
endif
|
2015-12-22 11:45:13 -05:00
|
|
|
|
2011-06-05 11:58:33 -04:00
|
|
|
# doc plain text
|
2013-12-24 23:50:24 -05:00
|
|
|
$(path_doc_output_plain): $(doc_imgs_txt)
|
|
|
|
makeinfo --plain -I "." "${path_easejs_texi}" -o "$@"
|
|
|
|
|
2014-01-17 22:27:47 -05:00
|
|
|
# doc html (multiple pages); override default target to call automake's
|
|
|
|
# first and then post-process output (it has no *-hook target support)
|
2013-12-24 23:55:14 -05:00
|
|
|
html: html-local html-am $(path_doc_output_html)/$(path_doc_css_ref)
|
2013-12-24 23:50:24 -05:00
|
|
|
sed -i '$(doc_replace)' easejs.html/*.htm?
|
2011-06-05 11:58:33 -04:00
|
|
|
|
|
|
|
# doc html (single page)
|
2013-12-24 23:50:24 -05:00
|
|
|
html-single: $(path_doc_output_html1)
|
|
|
|
$(path_doc_output_html1): html-local
|
|
|
|
$(MAKEINFO) --no-split --html --css-include="${path_doc_css}" \
|
2014-01-17 22:27:47 -05:00
|
|
|
-I . -o "$(path_doc_output_html1)" "${path_easejs_texi}" \
|
2013-12-24 23:50:24 -05:00
|
|
|
&& sed -i '$(doc_replace)' "$(path_doc_output_html1)"
|
2011-06-05 11:58:33 -04:00
|
|
|
|
|
|
|
# doc images (in build dir)
|
2011-11-29 19:48:26 -05:00
|
|
|
$(path_doc_output)/img: $(doc_imgs) | mkbuild-doc img
|
2011-06-05 11:58:33 -04:00
|
|
|
[ -d "$@" ] || mkdir -p $@
|
|
|
|
cp "$(path_doc_img)"/*.png $@
|
|
|
|
$(path_doc_output_html)/img: $(path_doc_output)/img
|
|
|
|
mkdir -p $(path_doc_output_html)
|
|
|
|
ln -s ../img $@
|
|
|
|
|
|
|
|
# interactive html doc (js)
|
2013-12-24 23:50:24 -05:00
|
|
|
$(path_doc_output_html)/%.js: %.js
|
2011-06-05 11:58:33 -04:00
|
|
|
cp $< $@
|
2013-12-24 23:50:24 -05:00
|
|
|
$(path_doc_output)/%.js: %.js
|
2011-06-05 11:58:33 -04:00
|
|
|
cp $< $@
|
|
|
|
|
|
|
|
# doc css
|
2013-12-24 23:50:24 -05:00
|
|
|
$(path_doc_output_html)/%.css: %.css
|
2011-06-05 11:58:33 -04:00
|
|
|
cp $< $@
|
|
|
|
|
|
|
|
|
2015-12-22 11:45:13 -05:00
|
|
|
img: $(doc_imgs) $(doc_imgs_eps)
|
2013-12-21 23:31:45 -05:00
|
|
|
|
2011-11-29 19:48:26 -05:00
|
|
|
plain: $(path_doc_output_plain)
|
2013-12-21 23:31:45 -05:00
|
|
|
install-plain: plain
|
|
|
|
install -d $(DESTDIR)$(docdir)
|
2014-01-17 22:27:47 -05:00
|
|
|
install -m644 $(path_doc_output_plain) \
|
|
|
|
$(DESTDIR)$(docdir)/easejs.txt
|
2013-12-21 23:31:45 -05:00
|
|
|
|
2013-12-24 23:50:24 -05:00
|
|
|
clean-local:
|
2015-12-22 11:45:13 -05:00
|
|
|
rm -rf $(doc_imgs) $(doc_imgs_eps)
|
2013-12-24 23:50:24 -05:00
|
|
|
rm -f $(path_doc_output_plain)
|
2011-06-05 11:58:33 -04:00
|
|
|
|