diff options
author | Case Duckworth | 2015-04-02 21:27:55 -0700 |
---|---|---|
committer | Case Duckworth | 2015-04-02 21:27:55 -0700 |
commit | d832dace648047cdeee32f295b7f1c799d0b5b50 (patch) | |
tree | 34f7efb6e713eef3522053a8ee2aded46ad1e33d /makefile | |
parent | Fix #15: add compile support for indeces (diff) | |
download | autocento-d832dace648047cdeee32f295b7f1c799d0b5b50.tar.gz autocento-d832dace648047cdeee32f295b7f1c799d0b5b50.zip |
Add Islands for backlinkless files
Diffstat (limited to 'makefile')
-rw-r--r-- | makefile | 80 |
1 files changed, 44 insertions, 36 deletions
diff --git a/makefile b/makefile index c6fc575..891de95 100644 --- a/makefile +++ b/makefile | |||
@@ -7,8 +7,8 @@ | |||
7 | srcs := $(wildcard *.txt) | 7 | srcs := $(wildcard *.txt) |
8 | templates := $(wildcard _template.*) | 8 | templates := $(wildcard _template.*) |
9 | trunk := trunk | 9 | trunk := trunk |
10 | metas = hapax first-lines common-titles index | 10 | metas = hapax first-lines common-titles index island |
11 | metas += $(templates) | 11 | metas += $(templates) $(wildcard _*) |
12 | 12 | ||
13 | txts = $(filter-out \ | 13 | txts = $(filter-out \ |
14 | $(patsubst %,%.txt,$(metas)),\ | 14 | $(patsubst %,%.txt,$(metas)),\ |
@@ -44,6 +44,10 @@ backHead = $(trunk)/backlink.head | |||
44 | backlinker = $(trunk)/backlink.sh | 44 | backlinker = $(trunk)/backlink.sh |
45 | backPandocOptions = --template=$(htmlTemplate) --smart | 45 | backPandocOptions = --template=$(htmlTemplate) --smart |
46 | 46 | ||
47 | islandHead = $(trunk)/island.head | ||
48 | islandTxt = island.txt | ||
49 | islandHtm = island.htm | ||
50 | |||
47 | firstLinesTxt = first-lines.txt | 51 | firstLinesTxt = first-lines.txt |
48 | firstLinesOut = first-lines.html | 52 | firstLinesOut = first-lines.html |
49 | firstLiner = $(trunk)/first-lines.sh | 53 | firstLiner = $(trunk)/first-lines.sh |
@@ -53,67 +57,71 @@ commonTitlesOut = common-titles.html | |||
53 | commonTitler = $(trunk)/common-titles.sh | 57 | commonTitler = $(trunk)/common-titles.sh |
54 | commonTitlesHead = $(trunk)/common-titles.head | 58 | commonTitlesHead = $(trunk)/common-titles.head |
55 | # }}} | 59 | # }}} |
56 | 60 | # PHONY {{{ | |
57 | .PHONY: all | 61 | .PHONY: all clean nuke again meta |
58 | all: $(hapaxOut) $(firstLinesOut) $(commonTitlesOut)\ | 62 | all: meta \ |
59 | $(htmlPre) $(htmls) $(lozengeOut)\ | 63 | $(htmlPre) $(htmls) $(lozengeOut)\ |
60 | $(backTxts) $(backHtms) | 64 | $(backHtms) $(islandHtm) |
61 | 65 | ||
66 | clean: | ||
67 | -rm -f $(hapaxs) $(hapaxOut) | ||
68 | -rm -f $(firstLinesOut) $(firstLinesTxt) | ||
69 | -rm -f $(commonTitlesOut) $(commonTitlesTxt) | ||
70 | -rm -f $(htmls) | ||
71 | -rm -f $(backTxts) $(backHtms) | ||
72 | -rm -f *.tmp trunk/*.tmp | ||
73 | |||
74 | nuke: clean | ||
75 | -rm -f $(hapaxPre) $(htmlPre) | ||
76 | |||
77 | again: clean all | ||
78 | |||
79 | meta: $(hapaxOut) $(firstLinesOut) $(commonTitlesOut) | ||
80 | # }}} | ||
62 | # HTML {{{ | 81 | # HTML {{{ |
63 | $(htmlPre): $(htmlPreSrc) | 82 | $(htmlPre): $(htmlPreSrc) |
64 | ghc --make $(htmlPreSrc) | 83 | ghc --make $(htmlPreSrc) |
65 | 84 | ||
66 | %.html: %.txt | $(htmlTemplate) $(htmlPre) | 85 | %.html: %.txt $(htmlTemplate) $(htmlPre) |
67 | pandoc $< -t html5 $(htmlPandocOptions) -o $@ | 86 | pandoc $< -t html5 $(htmlPandocOptions) -o $@ |
68 | 87 | ||
69 | $(lozengeOut): $(htmls) | 88 | $(lozengeOut): $(htmls) |
70 | @bash $(lozenger) $(lozengeOut) $(htmls) | 89 | bash $(lozenger) $(lozengeOut) $(htmls) |
71 | # }}} | 90 | # }}} |
72 | # BACKLINKS {{{ | 91 | # BACKLINKS {{{ |
73 | %.back: %.html | $(backHead) | 92 | %.back: %.html $(backHead) |
74 | @bash $(backlinker) $< $@ $(backHead) $(htmls) | 93 | @bash $(backlinker) $< $@ $(backHead) $(islandHead) $(txts) |
75 | 94 | ||
76 | %_backlinks.htm: %.back | $(htmlTemplate) | 95 | %_backlinks.htm: %.back |
77 | pandoc $< -t html5 $(backPandocOptions) -o $@ | 96 | pandoc $< -t html5 $(backPandocOptions) -o $@ |
97 | |||
98 | $(islandTxt): $(backTxts) | ||
99 | |||
100 | $(islandHtm): $(islandTxt) $(islandHead) $(backHtms) | ||
101 | pandoc $< -t html5 $(htmlPandocOptions) -o $@ | ||
102 | rm -f $(islandTxt) | ||
78 | # }}} | 103 | # }}} |
79 | # HAPAX {{{ | 104 | # HAPAX {{{ |
80 | $(hapaxPre): $(hapaxPreSrc) | 105 | $(hapaxPre): $(hapaxPreSrc) |
81 | ghc --make $(hapaxPreSrc) | 106 | ghc --make $(hapaxPreSrc) |
82 | 107 | ||
83 | %.hapax: %.txt | $(hapaxPre) | 108 | %.hapax: %.txt $(hapaxPre) $(hapaxLinker) $(hapaxHead) |
84 | pandoc $< -t $(hapaxer) $(hapaxPandocOptions) -o $@ | 109 | pandoc $< -t $(hapaxer) $(hapaxPandocOptions) -o $@ |
85 | 110 | ||
86 | $(hapaxOut): $(hapaxs) | $(hapaxPre) $(hapaxLinker) $(hapaxHead) | 111 | $(hapaxOut): $(hapaxs) |
87 | pandoc $^ -t $(hapaxer) -o $(hapaxOut) | 112 | pandoc $^ -t $(hapaxer) -o $@ |
88 | @bash $(hapaxLinker) $@ $(hapaxHead) $^ | 113 | bash $(hapaxLinker) $@ $(hapaxHead) $^ |
89 | # }}} | 114 | # }}} |
90 | # FIRST LINES & COMMON TITLES {{{ | 115 | # FIRST LINES & COMMON TITLES {{{ |
91 | $(firstLinesTxt): $(txts) | $(firstLiner) $(firstLinesHead) | 116 | $(firstLinesTxt): $(txts) | $(firstLiner) $(firstLinesHead) |
92 | @bash $(firstLiner) $@ $(firstLinesHead) $^ | 117 | bash $(firstLiner) $@ $(firstLinesHead) $^ |
93 | 118 | ||
94 | $(firstLinesOut): $(firstLinesTxt) | $(htmlTemplate) $(htmlPre) | 119 | $(firstLinesOut): $(firstLinesTxt) $(htmlTemplate) $(htmlPre) |
95 | pandoc $< -t html5 $(htmlPandocOptions) -o $@ | 120 | pandoc $< -t html5 $(htmlPandocOptions) -o $@ |
96 | 121 | ||
97 | $(commonTitlesTxt): $(txts) | $(commonTitler) $(commonTitlesHead) | 122 | $(commonTitlesTxt): $(txts) | $(commonTitler) $(commonTitlesHead) |
98 | @bash $(commonTitler) $@ $(commonTitlesHead) $^ | 123 | bash $(commonTitler) $@ $(commonTitlesHead) $^ |
99 | 124 | ||
100 | $(commonTitlesOut): $(commonTitlesTxt) | $(htmlTemplate) $(htmlPre) | 125 | $(commonTitlesOut): $(commonTitlesTxt) $(htmlTemplate) $(htmlPre) |
101 | pandoc $< -t html5 $(htmlPandocOptions) -o $@ | 126 | pandoc $< -t html5 $(htmlPandocOptions) -o $@ |
102 | # }}} | 127 | # }}} |
103 | # CLEAN {{{ | ||
104 | .PHONY: clean | ||
105 | clean: | ||
106 | -rm -f $(hapaxs) $(hapaxOut) | ||
107 | -rm -f $(firstLinesOut) $(firstLinesTxt) | ||
108 | -rm -f $(commonTitlesOut) $(commonTitlesTxt) | ||
109 | -rm -f $(htmls) | ||
110 | -rm -f $(backHtms) | ||
111 | -rm -f *.tmp trunk/*.tmp | ||
112 | |||
113 | .PHONY: nuke | ||
114 | nuke: clean | ||
115 | -rm -f $(hapaxPre) $(htmlPre) | ||
116 | |||
117 | .PHONY: again | ||
118 | again: clean all | ||
119 | # }}} | ||