diff options
author | Gordon GECOS <u@adam> | 2023-10-28 17:15:57 -0400 |
---|---|---|
committer | Gordon GECOS <u@adam> | 2023-10-28 17:30:20 -0400 |
commit | bc4c510fc48a39252c2436813670a2da80bdd2c4 (patch) | |
tree | 8beafbd1e47feaf23d215a74d9601648f8ab1dc2 | |
parent | 51b6e33d0dbb980a1977be8e2d29ca96d4781bcf (diff) |
infrastructure improvements
-rw-r--r-- | Makefile | 56 | ||||
-rw-r--r-- | title.txt | 66 |
2 files changed, 28 insertions, 94 deletions
@@ -1,17 +1,15 @@ | |||
1 | build/title.txt: title.txt | build | ||
2 | $(call concatenate_with_terminator,\\n\\n\\n) | ||
3 | build/page1.txt: way-to-be-great.txt lost-pen.txt authenticated-counterfeit.txt | build | ||
4 | $(call concatenate_with_terminator,\\n\\n\\n) | ||
5 | build/rest.txt: medium.txt argument.txt break dis.txt why.txt | build | ||
6 | $(call concatenate_with_terminator,\\n\\n\\n) | ||
7 | 1 | ||
8 | break: | 2 | pages = 64lines.txt space title.txt break |
9 | printf \\\\f > $@ | 3 | pages += way-to-be-great.txt space lost-pen.txt space authenticated-counterfeit.txt break |
10 | 4 | pages += monad-tutorial.txt break | |
11 | pages = title.txt monad-tutorial.txt page1.txt introduction.txt rest.txt | 5 | pages += why.txt space dis.txt break |
6 | pages += argument.txt space medium.txt break | ||
7 | pages += introduction.txt break | ||
12 | 8 | ||
13 | source_text_files = $(addprefix build/,$(pages)) | 9 | source_text_files = $(addprefix build/,$(pages)) |
14 | 10 | ||
11 | allorthree = $(if $(NOTITLE),3,all) | ||
12 | |||
15 | output_name = poetrybook | 13 | output_name = poetrybook |
16 | pdf_viewer = evince | 14 | pdf_viewer = evince |
17 | 15 | ||
@@ -38,7 +36,7 @@ LPDF += $(if $(NUMBER_UP),-o number-up=$(NUMBER_UP)) | |||
38 | LPDF += $(if $(SIDES),-o sides=$(SIDES)) | 36 | LPDF += $(if $(SIDES),-o sides=$(SIDES)) |
39 | 37 | ||
40 | define concatenate_with_terminator | 38 | define concatenate_with_terminator |
41 | @($(foreach f,$(^), cat < $(f) && [ $(f) = break ] || printf $(1);)) > $@.tmp | 39 | @($(foreach f,$(+), cat < $(f) && printf $(1);)) > $@.tmp |
42 | @$(done) | 40 | @$(done) |
43 | endef | 41 | endef |
44 | 42 | ||
@@ -50,8 +48,14 @@ done = mv -T -- $@.tmp $@ | |||
50 | 48 | ||
51 | .INTERMEDIATE: build/$(output_txt) | 49 | .INTERMEDIATE: build/$(output_txt) |
52 | 50 | ||
51 | build/break: | ||
52 | printf \\f > $@ | ||
53 | |||
54 | build/space: | ||
55 | printf \\n\\n\\n > $@ | ||
56 | |||
53 | build/$(output_txt): $(source_text_files) | build | 57 | build/$(output_txt): $(source_text_files) | build |
54 | $(call concatenate_with_terminator,\\f) | 58 | $(call concatenate_with_terminator,'') |
55 | 59 | ||
56 | %.pdf: %.txt | 60 | %.pdf: %.txt |
57 | $(LPDF) $< > $@.tmp | 61 | $(LPDF) $< > $@.tmp |
@@ -60,35 +64,31 @@ build/$(output_txt): $(source_text_files) | build | |||
60 | build/%: % | build | 64 | build/%: % | build |
61 | cp --reflink -T -- $< $@ | 65 | cp --reflink -T -- $< $@ |
62 | 66 | ||
63 | .PHONY: realprint print print3 printall clean preview realview titleview cleanview | 67 | clean: |
68 | -rm -rf build | ||
64 | 69 | ||
65 | cleanview: clean view3 | 70 | .PHONY: realprint print print3 printall clean preview realview titleview cleanview |
66 | 71 | ||
67 | preview: realview | 72 | cleanview: clean view$(allorthree) |
68 | 73 | ||
69 | print: clean print3 | 74 | print: clean print$(allorthree) |
70 | 75 | ||
71 | clean: | 76 | viewall: PAGES=1- |
72 | -rm -rf build | 77 | viewall: realview |
78 | printall: PAGES=1- | ||
79 | printall: realprint | ||
73 | 80 | ||
74 | view3: PAGES=3- | 81 | view3: PAGES=3- |
75 | view3: realview | 82 | view3: realview |
83 | print3: PAGES=3- | ||
84 | print3: realprint | ||
76 | 85 | ||
77 | titleview: PAGES=1-2 | 86 | preview: realview |
78 | titleview: realview | ||
79 | |||
80 | realview: build/$(output_pdf) | 87 | realview: build/$(output_pdf) |
81 | -$(pdf_viewer) $< & | 88 | -$(pdf_viewer) $< & |
82 | |||
83 | realprint: build/$(output_pdf) | 89 | realprint: build/$(output_pdf) |
84 | $(LP) $^ | 90 | $(LP) $^ |
85 | 91 | ||
86 | print3: PAGES=3- | ||
87 | print3: realprint | ||
88 | |||
89 | printall: PAGES=1- | ||
90 | printall: realprint | ||
91 | |||
92 | .PHONY: install | 92 | .PHONY: install |
93 | install: | 93 | install: |
94 | apt install --no-upgrade printer-driver-cups-pdf | 94 | apt install --no-upgrade printer-driver-cups-pdf |
@@ -1,67 +1,3 @@ | |||
1 | 1 | ||
2 | 2 | ||
3 | 3 | ||
4 | 4 | ||
5 | 5 | ||
6 | 6 | ||
7 | 7 | ||
8 | 8 | ||
9 | 9 | ||
10 | 10 | ||
11 | 11 | ||
12 | 12 | ||
13 | 13 | ||
14 | 14 | ||
15 | 15 | ||
16 | 16 | ||
17 | 17 | ||
18 | 18 | ||
19 | 19 | ||
20 | 20 | ||
21 | 21 | ||
22 | 22 | ||
23 | 23 | ||
24 | 24 | ||
25 | 25 | ||
26 | 26 | ||
27 | 27 | ||
28 | 28 | ||
29 | 29 | ||
30 | 30 | ||
31 | 31 | ||
32 | 32 | ||
33 | 33 | ||
34 | 34 | ||
35 | 35 | ||
36 | 36 | ||
37 | 37 | ||
38 | 38 | ||
39 | 39 | ||
40 | 40 | ||
41 | 41 | ||
42 | 42 | ||
43 | 43 | ||
44 | 44 | ||
45 | 45 | ||
46 | 46 | ||
47 | 47 | ||
48 | 48 | ||
49 | 49 | ||
50 | 50 | ||
51 | 51 | ||
52 | 52 | ||
53 | 53 | ||
54 | 54 | ||
55 | 55 | ||
56 | 56 | ||
57 | 57 | ||
58 | 58 | ||
59 | 59 | ||
60 | 60 | ||
61 | 61 | ||
62 | 62 | ||
63 | 63 | ||
64 | 64 | ||
65 | 1 | ||
66 | 2 | ||
67 | 3 | ||
@@ -106,5 +42,3 @@ | |||
106 | 42 | ||
107 | 43 | ||
108 | Ζυκο Δ Dειτα | 44 | Ζυκο Δ Dειτα |
109 | |||
110 | |||