forked from marijnh/Eloquent-JavaScript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
23 lines (16 loc) · 782 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
all: html tex
CHAPTERS := 00_intro 01_values 02_program_structure 03_functions 04_data 05_higher_order 06_object \
07_elife 08_error 09_regexp 10_modules 11_language 12_browser 13_dom 14_event 15_game
html: $(foreach CHAP,$(CHAPTERS),html/$(CHAP).html)
html/%.html: %.txt asciidoc_html.conf
PATH=node_modules/codemirror/bin:$(PATH) asciidoc -f asciidoc_html.conf --backend=html5 -o $@ $<
node bin/build_code.js $<
tex: $(foreach CHAP,$(CHAPTERS),tex/$(CHAP).tex)
tex/%.db: %.txt asciidoc_db.conf
asciidoc -f asciidoc_db.conf --backend=docbook -o $@ $<
tex/%.tex: tex/%.db
dblatex $< -o $@ -t tex
test:
@for F in $(CHAPTERS); do echo Testing $$F:; node bin/run_tests.js $$F.txt; done
@! grep '[a-zA-Z]_[—“”‘’]\|[—“”‘’]_[a-zA-Z]' *.txt
@echo Done.