aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2025-07-10 19:25:30 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2025-07-10 19:26:38 +0200
commit6a37ba289436cc09270cf63810888acb7df53002 (patch)
tree5eb802acf511b6c8941b202d7d7c9d9f4b037b39 /Makefile
parentb98c3fb1c46f6be09a1a5860340822ae9f5a6ecd (diff)
downloadconstance-ring-6a37ba289436cc09270cf63810888acb7df53002.tar.gz
constance-ring-6a37ba289436cc09270cf63810888acb7df53002.tar.bz2
constance-ring-6a37ba289436cc09270cf63810888acb7df53002.tar.xz
constance-ring-6a37ba289436cc09270cf63810888acb7df53002.zip
Reorganizing awk code
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile25
1 files changed, 10 insertions, 15 deletions
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,$^)