summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGordon GECOS <u@adam>2023-10-28 17:31:32 -0400
committerGordon GECOS <u@adam>2023-10-28 17:31:32 -0400
commit90e26dafc14883d6f619cf0ef4736482dda55458 (patch)
tree20ff112c3239fcd340e9fb5cd2cf9140e5a73f75
parent26b68e35990021cf8c4bdf6c9fda8544ada50ddf (diff)
infra
-rw-r--r--Makefile36
1 files changed, 10 insertions, 26 deletions
diff --git a/Makefile b/Makefile
index da3da3c..764d229 100644
--- a/Makefile
+++ b/Makefile
@@ -1,19 +1,14 @@
1 1pages = $(if $(TITLE),64lines.txt space title.txt break)
2pages = 64lines.txt space title.txt break
3pages += way-to-be-great.txt space lost-pen.txt space authenticated-counterfeit.txt break 2pages += way-to-be-great.txt space lost-pen.txt space authenticated-counterfeit.txt break
4pages += monad-tutorial.txt break 3pages += monad-tutorial.txt break
5pages += why.txt space dis.txt break 4pages += why.txt space dis.txt break
6pages += argument.txt space medium.txt break 5pages += argument.txt space medium.txt break
7pages += introduction.txt break 6pages += introduction.txt break
8 7
9source_text_files = $(addprefix build/,$(pages))
10
11allorthree = $(if $(NOTITLE),3,all)
12
13output_name = poetrybook 8output_name = poetrybook
14pdf_viewer = evince 9pdf_viewer = evince
15 10
16.DEFAULT_GOAL = cleanview 11.DEFAULT_GOAL = view
17output_txt = $(output_name).txt 12output_txt = $(output_name).txt
18output_pdf = $(output_name).pdf 13output_pdf = $(output_name).pdf
19 14
@@ -48,14 +43,15 @@ done = mv -T -- $@.tmp $@
48 43
49.INTERMEDIATE: build/$(output_txt) 44.INTERMEDIATE: build/$(output_txt)
50 45
51build/break: 46build/break: | build
52 printf \\f > $@ 47 printf \\f > $@
53 48
54build/space: 49build/space: | build
55 printf \\n\\n\\n > $@ 50 printf \\n\\n\\n > $@
56 51
57build/$(output_txt): $(source_text_files) | build 52build/$(output_txt): $(addprefix build/,$(pages)) | build
58 $(call concatenate_with_terminator,'') 53 cat $+ > $@.tmp
54 $(done)
59 55
60%.pdf: %.txt 56%.pdf: %.txt
61 $(LPDF) $< > $@.tmp 57 $(LPDF) $< > $@.tmp
@@ -67,23 +63,11 @@ build/%: % | build
67clean: 63clean:
68 -rm -rf build 64 -rm -rf build
69 65
70.PHONY: realprint print print3 printall clean preview realview titleview cleanview 66.PHONY: view print viewall printall realview realprint
71
72cleanview: clean view$(allorthree)
73
74print: clean print$(allorthree)
75
76viewall: PAGES=1-
77viewall: realview
78printall: PAGES=1-
79printall: realprint
80 67
81view3: PAGES=3- 68view: clean realview
82view3: realview 69print: clean realprint
83print3: PAGES=3-
84print3: realprint
85 70
86preview: realview
87realview: build/$(output_pdf) 71realview: build/$(output_pdf)
88 -$(pdf_viewer) $< & 72 -$(pdf_viewer) $< &
89realprint: build/$(output_pdf) 73realprint: build/$(output_pdf)