about summary refs log tree commit diff stats
path: root/makefile
diff options
context:
space:
mode:
authorCase Duckworth2015-04-02 17:34:26 -0700
committerCase Duckworth2015-04-02 17:34:26 -0700
commitbd9abbe4eb94b9c77865bd28bf73ec6eb0b39a95 (patch)
treeebfeb8135d5610aac69b8938d4dab09b23b758e2 /makefile
parentRefactor makefile; Add hapax preprocessor (diff)
downloadautocento-bd9abbe4eb94b9c77865bd28bf73ec6eb0b39a95.tar.gz
autocento-bd9abbe4eb94b9c77865bd28bf73ec6eb0b39a95.zip
Fix #15: add compile support for indeces
Diffstat (limited to 'makefile')
-rw-r--r--makefile40
1 files changed, 32 insertions, 8 deletions
diff --git a/makefile b/makefile index 4808e11..c6fc575 100644 --- a/makefile +++ b/makefile
@@ -10,9 +10,13 @@ trunk := trunk
10metas = hapax first-lines common-titles index 10metas = hapax first-lines common-titles index
11metas += $(templates) 11metas += $(templates)
12 12
13txts = $(filter-out \
14 $(patsubst %,%.txt,$(metas)),\
15 $(srcs))
16
13htmls = $(filter-out \ 17htmls = $(filter-out \
14 $(patsubst %,%.html,$(metas)),\ 18 $(patsubst %,%.html,$(metas)),\
15 $(patsubst %.txt,%.html,$(srcs))) 19 $(patsubst %.txt,%.html,$(srcs)))
16htmlPre = $(trunk)/versify.exe 20htmlPre = $(trunk)/versify.exe
17htmlPreSrc = $(trunk)/versify.hs 21htmlPreSrc = $(trunk)/versify.hs
18htmlTemplate = _template.html 22htmlTemplate = _template.html
@@ -24,8 +28,8 @@ lozenger = $(trunk)/lozenge.sh
24lozengeOut = $(trunk)/lozenge.js 28lozengeOut = $(trunk)/lozenge.js
25 29
26hapaxs = $(filter-out \ 30hapaxs = $(filter-out \
27 $(patsubst %,%.hapax,$(metas)),\ 31 $(patsubst %,%.hapax,$(metas)),\
28 $(patsubst %.txt,%.hapax,$(srcs))) 32 $(patsubst %.txt,%.hapax,$(srcs)))
29hapaxer = $(trunk)/hapax.lua 33hapaxer = $(trunk)/hapax.lua
30hapaxPre = $(trunk)/forceascii.exe 34hapaxPre = $(trunk)/forceascii.exe
31hapaxPreSrc = $(trunk)/forceascii.hs 35hapaxPreSrc = $(trunk)/forceascii.hs
@@ -39,10 +43,19 @@ backHtms = $(patsubst %.back,%_backlinks.htm,$(backTxts))
39backHead = $(trunk)/backlink.head 43backHead = $(trunk)/backlink.head
40backlinker = $(trunk)/backlink.sh 44backlinker = $(trunk)/backlink.sh
41backPandocOptions = --template=$(htmlTemplate) --smart 45backPandocOptions = --template=$(htmlTemplate) --smart
46
47firstLinesTxt = first-lines.txt
48firstLinesOut = first-lines.html
49firstLiner = $(trunk)/first-lines.sh
50firstLinesHead = $(trunk)/first-lines.head
51commonTitlesTxt = common-titles.txt
52commonTitlesOut = common-titles.html
53commonTitler = $(trunk)/common-titles.sh
54commonTitlesHead = $(trunk)/common-titles.head
42# }}} 55# }}}
43 56
44.PHONY: all 57.PHONY: all
45all: $(hapaxOut)\ 58all: $(hapaxOut) $(firstLinesOut) $(commonTitlesOut)\
46 $(htmlPre) $(htmls) $(lozengeOut)\ 59 $(htmlPre) $(htmls) $(lozengeOut)\
47 $(backTxts) $(backHtms) 60 $(backTxts) $(backHtms)
48 61
@@ -61,7 +74,7 @@ $(lozengeOut): $(htmls)
61 @bash $(backlinker) $< $@ $(backHead) $(htmls) 74 @bash $(backlinker) $< $@ $(backHead) $(htmls)
62 75
63%_backlinks.htm: %.back | $(htmlTemplate) 76%_backlinks.htm: %.back | $(htmlTemplate)
64 pandoc $< -t html5 $(backPandocOptions) -o $@ && rm $< 77 pandoc $< -t html5 $(backPandocOptions) -o $@
65# }}} 78# }}}
66# HAPAX {{{ 79# HAPAX {{{
67$(hapaxPre): $(hapaxPreSrc) 80$(hapaxPre): $(hapaxPreSrc)
@@ -73,15 +86,26 @@ $(hapaxPre): $(hapaxPreSrc)
73$(hapaxOut): $(hapaxs) | $(hapaxPre) $(hapaxLinker) $(hapaxHead) 86$(hapaxOut): $(hapaxs) | $(hapaxPre) $(hapaxLinker) $(hapaxHead)
74 pandoc $^ -t $(hapaxer) -o $(hapaxOut) 87 pandoc $^ -t $(hapaxer) -o $(hapaxOut)
75 @bash $(hapaxLinker) $@ $(hapaxHead) $^ 88 @bash $(hapaxLinker) $@ $(hapaxHead) $^
76 -rm *.hapax
77# }}} 89# }}}
78# FIRST LINES & COMMON TITLES {{{ 90# FIRST LINES & COMMON TITLES {{{
79# TODO 91$(firstLinesTxt): $(txts) | $(firstLiner) $(firstLinesHead)
92 @bash $(firstLiner) $@ $(firstLinesHead) $^
93
94$(firstLinesOut): $(firstLinesTxt) | $(htmlTemplate) $(htmlPre)
95 pandoc $< -t html5 $(htmlPandocOptions) -o $@
96
97$(commonTitlesTxt): $(txts) | $(commonTitler) $(commonTitlesHead)
98 @bash $(commonTitler) $@ $(commonTitlesHead) $^
99
100$(commonTitlesOut): $(commonTitlesTxt) | $(htmlTemplate) $(htmlPre)
101 pandoc $< -t html5 $(htmlPandocOptions) -o $@
80# }}} 102# }}}
81# CLEAN {{{ 103# CLEAN {{{
82.PHONY: clean 104.PHONY: clean
83clean: 105clean:
84 -rm -f $(hapaxs) $(hapaxOut) 106 -rm -f $(hapaxs) $(hapaxOut)
107 -rm -f $(firstLinesOut) $(firstLinesTxt)
108 -rm -f $(commonTitlesOut) $(commonTitlesTxt)
85 -rm -f $(htmls) 109 -rm -f $(htmls)
86 -rm -f $(backHtms) 110 -rm -f $(backHtms)
87 -rm -f *.tmp trunk/*.tmp 111 -rm -f *.tmp trunk/*.tmp