diff options
author | Case Duckworth | 2015-03-24 16:36:16 -0700 |
---|---|---|
committer | Case Duckworth | 2015-03-24 16:37:16 -0700 |
commit | 6c4eee52793bd93516516815604feac0793744fe (patch) | |
tree | 6e9ce7bc3051f3ade620197bbad21a6e468aa246 | |
parent | Makefile v.01 is alive (diff) | |
download | autocento-6c4eee52793bd93516516815604feac0793744fe.tar.gz autocento-6c4eee52793bd93516516815604feac0793744fe.zip |
Update Makefile to handle lozenge.js
-rw-r--r-- | src/makefile | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/makefile b/src/makefile index 800f8a0..dc8835c 100644 --- a/src/makefile +++ b/src/makefile | |||
@@ -11,9 +11,12 @@ HTMopts = --template=$(HTMLdir)/.template.html | |||
11 | HTMopts+= --smart --mathml --section-divs | 11 | HTMopts+= --smart --mathml --section-divs |
12 | RIVERs := $(patsubst %.txt,%.river,$(wildcard *.txt)) | 12 | RIVERs := $(patsubst %.txt,%.river,$(wildcard *.txt)) |
13 | RIVopts = | 13 | RIVopts = |
14 | LOZENGE = ../js/lozenge.js | ||
15 | LOZupd = ../js/update-lozenge.sh | ||
14 | 16 | ||
15 | # Do everything | 17 | # Do everything |
16 | all : $(HTMLs) $(RIVERs) | 18 | .PHONY: all |
19 | all : $(HTMLs) $(RIVERs) lozenge | ||
17 | 20 | ||
18 | # Generic rule for HTML targets and Markdown sources | 21 | # Generic rule for HTML targets and Markdown sources |
19 | %.html : %.txt | 22 | %.html : %.txt |
@@ -23,5 +26,12 @@ all : $(HTMLs) $(RIVERs) | |||
23 | %.river : %.txt | 26 | %.river : %.txt |
24 | pandoc $< -f markdown -t $(LUAdir)/river.lua $(RIVopts) -o $(RIVdir)/$@ | 27 | pandoc $< -f markdown -t $(LUAdir)/river.lua $(RIVopts) -o $(RIVdir)/$@ |
25 | 28 | ||
26 | # TODO: add lozenge updating | 29 | lozenge : $(HTMLdir)/$(HTMLs) |
27 | # AND compiling hapax | 30 | @echo "Updating lozenge.js..." |
31 | @list=`ls $(HTMLdir)/*.html |\ | ||
32 | sed -e 's,../,,g' |\ | ||
33 | tr '\n' ' ' |\ | ||
34 | sed -e 's/\(\S\+.html\) /"\1",/g'\ | ||
35 | -e 's/^\(.*\),$$/var files=[\1]/'` &&\ | ||
36 | sed -i "s/var files=.*/$$list/" $(LOZENGE) | ||
37 | # TODO: add compiling hapax | ||