belaran@976: include Makefile.vars belaran@976: belaran@976: # Makefile.vars includes the following system-dependent variables: belaran@976: # belaran@976: # dtd-url = the location of the DocBook 4.5 DTD on your filesystem belaran@976: # system-xsl-dir = the location of DocBook XSLT on your filesystem belaran@976: # dynamic-link-command = the command to link the DocBook XSLT to our styles belaran@976: # python = the location of Python 3.x on your filesystem belaran@976: belaran@976: xml-src-files := \ belaran@976: 00book.xml \ belaran@976: $(wildcard ch*.xml) \ belaran@976: $(wildcard app*.xml) \ belaran@976: bibliography.xml belaran@976: belaran@976: xsltproc-opts := --nonet --xinclude belaran@976: xmllint-opts := --noout --nonet --valid --path '$(dtd-url)' belaran@976: belaran@976: root-web := html belaran@976: support-web := $(root-web)/support belaran@976: obj-web := $(root-web)/read belaran@976: figs-web-folder := $(obj-web)/figs belaran@976: script-web := $(obj-web)/javascript belaran@976: web-global := ../web belaran@976: web-local := web belaran@976: belaran@976: html: $(obj-web)/index.html $(web-local)/index-read.html.in figs belaran@976: belaran@976: $(obj-web)/index.html: ../stylesheets/system-xsl .validated-00book.xml belaran@976: xsltproc $(xsltproc-opts) -o $(obj-web)/x ../stylesheets/it/web.xsl 00book.xml belaran@976: mkdir -p $(support-web) belaran@976: cp -f $(web-global)/icons/*.png $(support-web) belaran@976: cp $(web-global)/styles.css $(support-web) belaran@976: sed -i -e "s|figs/||g" $(support-web)/styles.css belaran@976: mkdir -p $(figs-web-folder) belaran@976: mkdir -p $(script-web) belaran@976: cp -f $(web-local)/*.js $(script-web) belaran@976: belaran@976: ../stylesheets/system-xsl: $(system-xsl-dir) belaran@976: $(dynamic-link-command) belaran@976: belaran@976: $(web-local)/index-read.html.in: $(web-local)/genindex.py $(xml-src-files) belaran@976: cp $(web-local)/index-template.html $(obj-web)/index.html belaran@976: sed -i -e "s|{% block bodycontent %}{% endblock %}|$(shell cat $(web-local)/index-read.html.in)|g" $(obj-web)/index.html belaran@976: sed -i -e "s|/support/|../support/|g" $(obj-web)/*.html belaran@976: cp $(web-local)/index-template.html $(root-web)/index.html belaran@976: sed -i "s|{% block bodycontent %}{% endblock %}|$(shell cat $(web-local)/index-home.html.in)|g" $(root-web)/index.html belaran@976: sed -i -e "s|/support/|support/|g" $(root-web)/index.html belaran@976: belaran@976: $(web-local)/genindex.py: $(xml-src-files) belaran@976: cd $(web-local) && $(python) genindex.py belaran@976: belaran@976: valid: .validated-00book.xml belaran@976: belaran@976: .validated-00book.xml: $(xml-src-files) belaran@976: xmllint $(xmllint-opts) $< belaran@976: touch $@ belaran@976: belaran@976: clean: belaran@976: rm -f $(web-local)/index-read.html.in belaran@976: rm -f .validated-00book.xml belaran@976: rm -rf $(root-web) belaran@976: belaran@976: image-folder := figs belaran@976: # graphs, figures, screenshots belaran@976: image-files := $(wildcard $(image-folder)/*.dot $(image-folder)/*.svg $(image-folder)/*.png) belaran@976: # graphs belaran@976: image-dot := $(filter %.dot, $(image-files)) belaran@976: # figures belaran@976: image-svg := $(filter %.svg, $(image-files)) belaran@976: # screenshots belaran@976: image-png := $(filter %.png, $(image-files)) belaran@976: belaran@976: figs-web := \ belaran@976: $(image-dot:$(image-folder)/%.dot=$(figs-web-folder)/%.png) \ belaran@976: $(image-svg:$(image-folder)/%.svg=$(figs-web-folder)/%.png) \ belaran@976: $(image-png:$(image-folder)/%.png=$(figs-web-folder)/%.png) belaran@976: belaran@976: figs: $(figs-web) belaran@976: belaran@976: $(figs-web-folder)/%.png: $(image-folder)/%.svg belaran@976: inkscape -D -d 120 -e $@ $< belaran@976: belaran@976: $(figs-web-folder)/%.png: $(figs-web-folder)/%.svg belaran@976: inkscape -D -e $@ $< belaran@976: rm $< belaran@976: belaran@976: $(figs-web-folder)/%.png: $(image-folder)/%.png belaran@976: cp $< $@ belaran@976: belaran@976: $(figs-web-folder)/%.svg: $(image-folder)/%.dot belaran@976: dot -Tsvg -o $@ $<