diff options
author | Gordon GECOS <u@adam> | 2023-10-28 17:31:32 -0400 |
---|---|---|
committer | Gordon GECOS <u@adam> | 2023-10-28 17:31:32 -0400 |
commit | 90e26dafc14883d6f619cf0ef4736482dda55458 (patch) | |
tree | 20ff112c3239fcd340e9fb5cd2cf9140e5a73f75 | |
parent | 26b68e35990021cf8c4bdf6c9fda8544ada50ddf (diff) |
infra
-rw-r--r-- | Makefile | 36 |
1 files changed, 10 insertions, 26 deletions
@@ -1,19 +1,14 @@ | |||
1 | 1 | pages = $(if $(TITLE),64lines.txt space title.txt break) | |
2 | pages = 64lines.txt space title.txt break | ||
3 | pages += way-to-be-great.txt space lost-pen.txt space authenticated-counterfeit.txt break | 2 | pages += way-to-be-great.txt space lost-pen.txt space authenticated-counterfeit.txt break |
4 | pages += monad-tutorial.txt break | 3 | pages += monad-tutorial.txt break |
5 | pages += why.txt space dis.txt break | 4 | pages += why.txt space dis.txt break |
6 | pages += argument.txt space medium.txt break | 5 | pages += argument.txt space medium.txt break |
7 | pages += introduction.txt break | 6 | pages += introduction.txt break |
8 | 7 | ||
9 | source_text_files = $(addprefix build/,$(pages)) | ||
10 | |||
11 | allorthree = $(if $(NOTITLE),3,all) | ||
12 | |||
13 | output_name = poetrybook | 8 | output_name = poetrybook |
14 | pdf_viewer = evince | 9 | pdf_viewer = evince |
15 | 10 | ||
16 | .DEFAULT_GOAL = cleanview | 11 | .DEFAULT_GOAL = view |
17 | output_txt = $(output_name).txt | 12 | output_txt = $(output_name).txt |
18 | output_pdf = $(output_name).pdf | 13 | output_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 | ||
51 | build/break: | 46 | build/break: | build |
52 | printf \\f > $@ | 47 | printf \\f > $@ |
53 | 48 | ||
54 | build/space: | 49 | build/space: | build |
55 | printf \\n\\n\\n > $@ | 50 | printf \\n\\n\\n > $@ |
56 | 51 | ||
57 | build/$(output_txt): $(source_text_files) | build | 52 | build/$(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 | |||
67 | clean: | 63 | clean: |
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 | |||
72 | cleanview: clean view$(allorthree) | ||
73 | |||
74 | print: clean print$(allorthree) | ||
75 | |||
76 | viewall: PAGES=1- | ||
77 | viewall: realview | ||
78 | printall: PAGES=1- | ||
79 | printall: realprint | ||
80 | 67 | ||
81 | view3: PAGES=3- | 68 | view: clean realview |
82 | view3: realview | 69 | print: clean realprint |
83 | print3: PAGES=3- | ||
84 | print3: realprint | ||
85 | 70 | ||
86 | preview: realview | ||
87 | realview: build/$(output_pdf) | 71 | realview: build/$(output_pdf) |
88 | -$(pdf_viewer) $< & | 72 | -$(pdf_viewer) $< & |
89 | realprint: build/$(output_pdf) | 73 | realprint: build/$(output_pdf) |