From 6a37ba289436cc09270cf63810888acb7df53002 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Thu, 10 Jul 2025 19:25:30 +0200 Subject: Reorganizing awk code --- Makefile | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 169bf9d..399e42d 100644 --- a/Makefile +++ b/Makefile @@ -33,27 +33,22 @@ txt/page-%.txt:image/page-%.jpg stage-1.txt: $(TXTs) cat txt/page-{014..328}.txt > $@ -stage-2.txt: stage-1.txt +stage-2.txt: stage-1.txt stage-2.awk @echo '#' $@ - @# tr '\f' '\n' < $< > $@ - @cp $< $@ - -stage-3.txt: stage-2.txt convert.awk - @echo '#' $@ - @awk -f convert.awk $< > $@.tmp + awk -f $(filter %.awk,$^) $< > $@.tmp @mv $@.tmp $@ -stage-4.txt: stage-3.txt Makefile +stage-3.txt: stage-2.txt stage-3.awk @echo '#' $@ - @uniq $< > $@.tmp + awk -f $(filter %.awk,$^) $< > $@.tmp @mv $@.tmp $@ -stage-5.txt: stage-4.txt convert2.awk +stage-4.txt: stage-3.txt stage-4.awk @echo '#' $@ - awk -f convert2.awk $< > $@.tmp + awk -f $(filter %.awk,$^) $< > $@.tmp @mv $@.tmp $@ -stage-6.md: stage-5.txt Makefile +stage-5.md: stage-4.txt Makefile @echo '#' $@ @pandoc --from markdown -o $@.tmp.md $< @mv $@.tmp.md $@ @@ -67,15 +62,15 @@ dict.tmp: dict grep -v "^$$" |\ uniq > dict.tmp && cp dict.tmp dict -spellcheck: stage-6.md +spellcheck: stage-5.md hunspell -p $$(pwd)/dict -d nb_NO,constance-ring $< -spellcheck-words: stage-6.md dict.tmp constance-ring.dic +spellcheck-words: stage-5.md dict.tmp constance-ring.dic @echo hunspell hunspell -p $$(pwd)/dict -d nb_NO,constance-ring -l < $< | sort | uniq -c | sort -n > $@.tmp @mv $@.tmp spellcheck-words -constance-ring.epub: header.md stage-6.md spellcheck-words +constance-ring.epub: header.md stage-5.md spellcheck-words @echo '#' $@ @pandoc --toc -o $@ $(filter %.md,$^) -- cgit v1.2.3