diff options
Diffstat (limited to 'makefile')
-rw-r--r-- | makefile | 40 |
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 | |||
10 | metas = hapax first-lines common-titles index | 10 | metas = hapax first-lines common-titles index |
11 | metas += $(templates) | 11 | metas += $(templates) |
12 | 12 | ||
13 | txts = $(filter-out \ | ||
14 | $(patsubst %,%.txt,$(metas)),\ | ||
15 | $(srcs)) | ||
16 | |||
13 | htmls = $(filter-out \ | 17 | htmls = $(filter-out \ |
14 | $(patsubst %,%.html,$(metas)),\ | 18 | $(patsubst %,%.html,$(metas)),\ |
15 | $(patsubst %.txt,%.html,$(srcs))) | 19 | $(patsubst %.txt,%.html,$(srcs))) |
16 | htmlPre = $(trunk)/versify.exe | 20 | htmlPre = $(trunk)/versify.exe |
17 | htmlPreSrc = $(trunk)/versify.hs | 21 | htmlPreSrc = $(trunk)/versify.hs |
18 | htmlTemplate = _template.html | 22 | htmlTemplate = _template.html |
@@ -24,8 +28,8 @@ lozenger = $(trunk)/lozenge.sh | |||
24 | lozengeOut = $(trunk)/lozenge.js | 28 | lozengeOut = $(trunk)/lozenge.js |
25 | 29 | ||
26 | hapaxs = $(filter-out \ | 30 | hapaxs = $(filter-out \ |
27 | $(patsubst %,%.hapax,$(metas)),\ | 31 | $(patsubst %,%.hapax,$(metas)),\ |
28 | $(patsubst %.txt,%.hapax,$(srcs))) | 32 | $(patsubst %.txt,%.hapax,$(srcs))) |
29 | hapaxer = $(trunk)/hapax.lua | 33 | hapaxer = $(trunk)/hapax.lua |
30 | hapaxPre = $(trunk)/forceascii.exe | 34 | hapaxPre = $(trunk)/forceascii.exe |
31 | hapaxPreSrc = $(trunk)/forceascii.hs | 35 | hapaxPreSrc = $(trunk)/forceascii.hs |
@@ -39,10 +43,19 @@ backHtms = $(patsubst %.back,%_backlinks.htm,$(backTxts)) | |||
39 | backHead = $(trunk)/backlink.head | 43 | backHead = $(trunk)/backlink.head |
40 | backlinker = $(trunk)/backlink.sh | 44 | backlinker = $(trunk)/backlink.sh |
41 | backPandocOptions = --template=$(htmlTemplate) --smart | 45 | backPandocOptions = --template=$(htmlTemplate) --smart |
46 | |||
47 | firstLinesTxt = first-lines.txt | ||
48 | firstLinesOut = first-lines.html | ||
49 | firstLiner = $(trunk)/first-lines.sh | ||
50 | firstLinesHead = $(trunk)/first-lines.head | ||
51 | commonTitlesTxt = common-titles.txt | ||
52 | commonTitlesOut = common-titles.html | ||
53 | commonTitler = $(trunk)/common-titles.sh | ||
54 | commonTitlesHead = $(trunk)/common-titles.head | ||
42 | # }}} | 55 | # }}} |
43 | 56 | ||
44 | .PHONY: all | 57 | .PHONY: all |
45 | all: $(hapaxOut)\ | 58 | all: $(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 |
83 | clean: | 105 | clean: |
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 |