@@ -4,9 +4,13 @@ CHAPTERS := 00_intro 01_values 02_program_structure 03_functions 04_data 05_high
44 07_elife 08_error 09_regexp 10_modules 11_language 12_browser 13_dom 14_event 15_game 16_canvas \
55 17_http 18_forms 19_paint 20_node 21_skillsharing
66
7+ SVGS := $(wildcard img/* .svg)
8+
79.SECONDARY : $(foreach CHAP,$(CHAPTERS ) ,tex/$(CHAP ) .db)
810
9- html : $(foreach CHAP,$(CHAPTERS ) ,html/$(CHAP ) .html) html/js/chapter_info.js code/skillsharing.zip code/solutions/20_4_a_public_space_on_the_web.zip
11+ html : $(foreach CHAP,$(CHAPTERS ) ,html/$(CHAP ) .html) html/js/chapter_info.js \
12+ code/skillsharing.zip code/solutions/20_4_a_public_space_on_the_web.zip \
13+ $(patsubst img/%.svg,img/generated/%.png,$(SVGS))
1014
1115html/% .html : % .txt asciidoc_html.conf
1216 PATH=node_modules/codemirror/bin:$(PATH ) asciidoc -f asciidoc_html.conf --backend=html5 -o $@ $<
@@ -15,6 +19,12 @@ html/%.html: %.txt asciidoc_html.conf
1519html/js/chapter_info.js : $(foreach CHAP,$(CHAPTERS ) ,$(CHAP ) .txt) code/solutions/* bin/chapter_info.js
1620 node bin/chapter_info.js > html/js/chapter_info.js
1721
22+ img/generated/% .png : img/% .svg
23+ inkscape --export-png=$@ $<
24+
25+ img/generated/% .pdf : img/% .svg
26+ inkscape --export-pdf=$@ $<
27+
1828code/skillsharing.zip : html/21_skillsharing.html
1929 rm -f $@
2030 cd code; zip skillsharing.zip skillsharing/* .js* skillsharing/public/* .*
@@ -38,7 +48,8 @@ test: html
3848 @node bin/check_links.js
3949 @echo Done.
4050
41- book.pdf : tex/book/book.tex $(foreach CHAP,$(CHAPTERS ) ,tex/$(CHAP ) .tex) tex/solutions.tex
51+ book.pdf : tex/book/book.tex $(foreach CHAP,$(CHAPTERS ) ,tex/$(CHAP ) .tex) tex/solutions.tex \
52+ $(patsubst img/%.svg,img/generated/%.pdf,$(SVGS))
4253 cd tex/book && xelatex book.tex
4354 cd tex/book && xelatex book.tex
4455 makeindex -s tex/book/nostarch.ist -o tex/book/book.ind tex/book/book.idx
0 commit comments