From bd9abbe4eb94b9c77865bd28bf73ec6eb0b39a95 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Thu, 2 Apr 2015 17:34:26 -0700 Subject: Fix #15: add compile support for indeces --- makefile | 40 ++++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-) (limited to 'makefile') diff --git a/makefile b/makefile index 4808e11..c6fc575 100644 --- a/makefile +++ b/makefile @@ -10,9 +10,13 @@ trunk := trunk metas = hapax first-lines common-titles index metas += $(templates) +txts = $(filter-out \ + $(patsubst %,%.txt,$(metas)),\ + $(srcs)) + htmls = $(filter-out \ - $(patsubst %,%.html,$(metas)),\ - $(patsubst %.txt,%.html,$(srcs))) + $(patsubst %,%.html,$(metas)),\ + $(patsubst %.txt,%.html,$(srcs))) htmlPre = $(trunk)/versify.exe htmlPreSrc = $(trunk)/versify.hs htmlTemplate = _template.html @@ -24,8 +28,8 @@ lozenger = $(trunk)/lozenge.sh lozengeOut = $(trunk)/lozenge.js hapaxs = $(filter-out \ - $(patsubst %,%.hapax,$(metas)),\ - $(patsubst %.txt,%.hapax,$(srcs))) + $(patsubst %,%.hapax,$(metas)),\ + $(patsubst %.txt,%.hapax,$(srcs))) hapaxer = $(trunk)/hapax.lua hapaxPre = $(trunk)/forceascii.exe hapaxPreSrc = $(trunk)/forceascii.hs @@ -39,10 +43,19 @@ backHtms = $(patsubst %.back,%_backlinks.htm,$(backTxts)) backHead = $(trunk)/backlink.head backlinker = $(trunk)/backlink.sh backPandocOptions = --template=$(htmlTemplate) --smart + +firstLinesTxt = first-lines.txt +firstLinesOut = first-lines.html +firstLiner = $(trunk)/first-lines.sh +firstLinesHead = $(trunk)/first-lines.head +commonTitlesTxt = common-titles.txt +commonTitlesOut = common-titles.html +commonTitler = $(trunk)/common-titles.sh +commonTitlesHead = $(trunk)/common-titles.head # }}} .PHONY: all -all: $(hapaxOut)\ +all: $(hapaxOut) $(firstLinesOut) $(commonTitlesOut)\ $(htmlPre) $(htmls) $(lozengeOut)\ $(backTxts) $(backHtms) @@ -61,7 +74,7 @@ $(lozengeOut): $(htmls) @bash $(backlinker) $< $@ $(backHead) $(htmls) %_backlinks.htm: %.back | $(htmlTemplate) - pandoc $< -t html5 $(backPandocOptions) -o $@ && rm $< + pandoc $< -t html5 $(backPandocOptions) -o $@ # }}} # HAPAX {{{ $(hapaxPre): $(hapaxPreSrc) @@ -73,15 +86,26 @@ $(hapaxPre): $(hapaxPreSrc) $(hapaxOut): $(hapaxs) | $(hapaxPre) $(hapaxLinker) $(hapaxHead) pandoc $^ -t $(hapaxer) -o $(hapaxOut) @bash $(hapaxLinker) $@ $(hapaxHead) $^ - -rm *.hapax # }}} # FIRST LINES & COMMON TITLES {{{ -# TODO +$(firstLinesTxt): $(txts) | $(firstLiner) $(firstLinesHead) + @bash $(firstLiner) $@ $(firstLinesHead) $^ + +$(firstLinesOut): $(firstLinesTxt) | $(htmlTemplate) $(htmlPre) + pandoc $< -t html5 $(htmlPandocOptions) -o $@ + +$(commonTitlesTxt): $(txts) | $(commonTitler) $(commonTitlesHead) + @bash $(commonTitler) $@ $(commonTitlesHead) $^ + +$(commonTitlesOut): $(commonTitlesTxt) | $(htmlTemplate) $(htmlPre) + pandoc $< -t html5 $(htmlPandocOptions) -o $@ # }}} # CLEAN {{{ .PHONY: clean clean: -rm -f $(hapaxs) $(hapaxOut) + -rm -f $(firstLinesOut) $(firstLinesTxt) + -rm -f $(commonTitlesOut) $(commonTitlesTxt) -rm -f $(htmls) -rm -f $(backHtms) -rm -f *.tmp trunk/*.tmp -- cgit 1.4.1-21-gabe81