hgbook

annotate it/Makefile @ 976:713f0f69029a

merge with Italian, and very (few) work on ch03
author Romain PELISSE <belaran@gmail.com>
date Fri Sep 04 16:33:35 2009 +0200 (2009-09-04)
parents
children 719b03ea27c8
rev   line source
belaran@976 1 include Makefile.vars
belaran@976 2
belaran@976 3 # Makefile.vars includes the following system-dependent variables:
belaran@976 4 #
belaran@976 5 # dtd-url = the location of the DocBook 4.5 DTD on your filesystem
belaran@976 6 # system-xsl-dir = the location of DocBook XSLT on your filesystem
belaran@976 7 # dynamic-link-command = the command to link the DocBook XSLT to our styles
belaran@976 8 # python = the location of Python 3.x on your filesystem
belaran@976 9
belaran@976 10 xml-src-files := \
belaran@976 11 00book.xml \
belaran@976 12 $(wildcard ch*.xml) \
belaran@976 13 $(wildcard app*.xml) \
belaran@976 14 bibliography.xml
belaran@976 15
belaran@976 16 xsltproc-opts := --nonet --xinclude
belaran@976 17 xmllint-opts := --noout --nonet --valid --path '$(dtd-url)'
belaran@976 18
belaran@976 19 root-web := html
belaran@976 20 support-web := $(root-web)/support
belaran@976 21 obj-web := $(root-web)/read
belaran@976 22 figs-web-folder := $(obj-web)/figs
belaran@976 23 script-web := $(obj-web)/javascript
belaran@976 24 web-global := ../web
belaran@976 25 web-local := web
belaran@976 26
belaran@976 27 html: $(obj-web)/index.html $(web-local)/index-read.html.in figs
belaran@976 28
belaran@976 29 $(obj-web)/index.html: ../stylesheets/system-xsl .validated-00book.xml
belaran@976 30 xsltproc $(xsltproc-opts) -o $(obj-web)/x ../stylesheets/it/web.xsl 00book.xml
belaran@976 31 mkdir -p $(support-web)
belaran@976 32 cp -f $(web-global)/icons/*.png $(support-web)
belaran@976 33 cp $(web-global)/styles.css $(support-web)
belaran@976 34 sed -i -e "s|figs/||g" $(support-web)/styles.css
belaran@976 35 mkdir -p $(figs-web-folder)
belaran@976 36 mkdir -p $(script-web)
belaran@976 37 cp -f $(web-local)/*.js $(script-web)
belaran@976 38
belaran@976 39 ../stylesheets/system-xsl: $(system-xsl-dir)
belaran@976 40 $(dynamic-link-command)
belaran@976 41
belaran@976 42 $(web-local)/index-read.html.in: $(web-local)/genindex.py $(xml-src-files)
belaran@976 43 cp $(web-local)/index-template.html $(obj-web)/index.html
belaran@976 44 sed -i -e "s|{% block bodycontent %}{% endblock %}|$(shell cat $(web-local)/index-read.html.in)|g" $(obj-web)/index.html
belaran@976 45 sed -i -e "s|/support/|../support/|g" $(obj-web)/*.html
belaran@976 46 cp $(web-local)/index-template.html $(root-web)/index.html
belaran@976 47 sed -i "s|{% block bodycontent %}{% endblock %}|$(shell cat $(web-local)/index-home.html.in)|g" $(root-web)/index.html
belaran@976 48 sed -i -e "s|/support/|support/|g" $(root-web)/index.html
belaran@976 49
belaran@976 50 $(web-local)/genindex.py: $(xml-src-files)
belaran@976 51 cd $(web-local) && $(python) genindex.py
belaran@976 52
belaran@976 53 valid: .validated-00book.xml
belaran@976 54
belaran@976 55 .validated-00book.xml: $(xml-src-files)
belaran@976 56 xmllint $(xmllint-opts) $<
belaran@976 57 touch $@
belaran@976 58
belaran@976 59 clean:
belaran@976 60 rm -f $(web-local)/index-read.html.in
belaran@976 61 rm -f .validated-00book.xml
belaran@976 62 rm -rf $(root-web)
belaran@976 63
belaran@976 64 image-folder := figs
belaran@976 65 # graphs, figures, screenshots
belaran@976 66 image-files := $(wildcard $(image-folder)/*.dot $(image-folder)/*.svg $(image-folder)/*.png)
belaran@976 67 # graphs
belaran@976 68 image-dot := $(filter %.dot, $(image-files))
belaran@976 69 # figures
belaran@976 70 image-svg := $(filter %.svg, $(image-files))
belaran@976 71 # screenshots
belaran@976 72 image-png := $(filter %.png, $(image-files))
belaran@976 73
belaran@976 74 figs-web := \
belaran@976 75 $(image-dot:$(image-folder)/%.dot=$(figs-web-folder)/%.png) \
belaran@976 76 $(image-svg:$(image-folder)/%.svg=$(figs-web-folder)/%.png) \
belaran@976 77 $(image-png:$(image-folder)/%.png=$(figs-web-folder)/%.png)
belaran@976 78
belaran@976 79 figs: $(figs-web)
belaran@976 80
belaran@976 81 $(figs-web-folder)/%.png: $(image-folder)/%.svg
belaran@976 82 inkscape -D -d 120 -e $@ $<
belaran@976 83
belaran@976 84 $(figs-web-folder)/%.png: $(figs-web-folder)/%.svg
belaran@976 85 inkscape -D -e $@ $<
belaran@976 86 rm $<
belaran@976 87
belaran@976 88 $(figs-web-folder)/%.png: $(image-folder)/%.png
belaran@976 89 cp $< $@
belaran@976 90
belaran@976 91 $(figs-web-folder)/%.svg: $(image-folder)/%.dot
belaran@976 92 dot -Tsvg -o $@ $<