◊(Local Yarn Code "Check-in [ec9ab7ab]")

Overview
Comment:Makefile: SQLite file to replace zero-byte file in dependency tree. Also rename spritz → zap
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: ec9ab7aba48d3f38339d25c2dd4c5b6d907483d1748374e2bdd7d823a2655e66
User & Date: joel on 2019-08-18 19:17:16
Other Links: manifest | tags
Context
2019-08-18
20:06
Add notice to index preprocess source check-in: 1346740b user: joel tags: trunk
19:17
Makefile: SQLite file to replace zero-byte file in dependency tree. Also rename spritz → zap check-in: ec9ab7ab user: joel tags: trunk
2019-07-28
16:36
Add rough home page, finally close [3514e657bf79a443] check-in: a770b922 user: joel tags: trunk
Changes

Modified makefile from [557f6398] to [c6be5061].

16
17
18
19
20
21
22
23

24
25
26
27
28
29
30




31
32
33
34
35
36
37
38
39
40
41
42



43
44
45
46
47
48
49
16
17
18
19
20
21
22

23
24
25
26




27
28
29
30
31
32
33
34
35
36
37

38



39
40
41
42
43
44
45
46
47
48







-
+



-
-
-
-
+
+
+
+







-

-
-
-
+
+
+







series-sources  := $(wildcard series/*.poly.pm)
series-html     := $(patsubst %.poly.pm, %.html, $(series-sources))

# ~~~ Rules ~~
#

# The order of these dependencies is important. They will be processed left to right.
web: _article_htmls.mark $(articles-html) $(series-html) 
web: vitreous.sqlite $(articles-html) $(series-html) 
web: index.html blog-pg1.html keyword-index.html web-extra/martin.css
web: ## Rebuild all web content (not PDFs)

# The file article_htmls.mark is a zero-byte file that serves only as a marker. If it is older than
# any of its dependencies (or missing) all of the articles will be rebuilt. Its dependencies are
# also on the Pollen cache watchlist (see pollen.rkt)
_article_htmls.mark: $(core-files) $(html-deps) template.html.p
# The file vitreous.sqlite is a cache of the rendered HTML and metadata. If it is older than any of
# its dependencies (or missing) all of the articles will be rebuilt. Its dependencies are also on
# the Pollen cache watchlist (see pollen.rkt)
vitreous.sqlite: $(core-files) $(html-deps) template.html.p
	raco pollen setup -p articles/
	raco pollen render -p -t html articles/*.poly.pm
	raco pollen setup -p series/
	raco pollen render -p -t html series/*.poly.pm
	rm -f template.html series/template.html
	# tidy -quiet -modify -indent --wrap 100 --wrap-attributes no --tidy-mark no articles/*.html || true
	# tidy -quiet -modify -indent --wrap 100 --wrap-attributes no --tidy-mark no series/*.html || true
	touch _article_htmls.mark

# If the rule for article_htmls.mark was triggered, all the article HTML files will already have
# been re-rendered.  (That rule comes before this one in the list of dependencies for "all") But if
# not, any individual files that have been edited will get re-rendered.
# If the rule for vitreous.sqlite was triggered, all the article HTML files will already have been
# re-rendered.  (That rule comes before this one in the list of dependencies for "all") But if not,
# any individual files that have been edited will get re-rendered.
$(articles-html): %.html: %.poly.pm 
	raco pollen render $@
	# tidy -quiet -modify -indent --wrap 100 --wrap-attributes no --tidy-mark no $@ || true

# Note that if any article is part of a series, it will touch its series .poly.pm file during its
# render, triggering this rule for that series.
$(series-html): %.html: %.poly.pm
62
63
64
65
66
67
68
69

70
71

72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
61
62
63
64
65
66
67

68
69

70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89

90
91
92
93
94
95
96







-
+

-
+



















-







keyword-index.html: $(core-files) $(html-deps) $(articles-html) keyword-index.rkt
	racket -tm keyword-index.rkt
	# tidy -quiet -modify -indent --wrap 100 --wrap-attributes no --tidy-mark no $@ || true

web-extra/martin.css: web-extra/martin.css.pp
	raco pollen render $@

spritz: ## Clear Pollen and Scribble cache, and remove all HTML output
zap: ## Clear Pollen and Scribble cache, and remove all HTML output
	raco pollen reset
	rm -f *.html articles/*.html series/*.html _article_htmls.mark
	rm -f *.html articles/*.html series/*.html vitreous.sqlite 

publish: check-env
publish: ## Sync all HTML and PDF stuff to the public web server (does not rebuild any files)
	raco pollen publish
	./util/relativize ~/Desktop/publish/
	rsync -av ~/Desktop/publish/ -e 'ssh -p $(WEB_SRV_PORT)' $(LOCALYARN_SRV) \
		--delete \
		--exclude=drafts \
		--exclude=code-docs \
		--exclude=util \
		--exclude=x-mockup \
		--exclude=repo-www \
		--exclude=scribbled \
		--exclude='*.sqlite' \
		--exclude='*.fossil' \
		--exclude=.fossil-settings \
		--exclude=.fslckout \
		--exclude='*.ltx' \
		--exclude='*.swp' \
		--exclude='*.mark' \
		--exclude=.DS_Store \
	    --exclude='template*.*' \
		--exclude=makefile 
	rm -rf ~/Desktop/publish

scribble: ## Rebuild code documentation and update Fossil repo
	scribble --htmls +m --redirect https://docs.racket-lang.org/local-redirect/ code-docs/main.scrbl
107
108
109
110
111
112
113
114

115
116
117
118
119
120
121
122
123
124
105
106
107
108
109
110
111

112
113
114
115
116
117
118
119
120
121
122







-
+










# Self-documenting makefile (http://marmelab.com/blog/2016/02/29/auto-documented-makefile.html)
help: ## Displays this help screen
	@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}'

article: ## Start a new article from a template
	racket -tm util/newpost.rkt

.PHONY: all scribble help spritz article publish check-env
.PHONY: all scribble help zap article publish check-env

.DEFAULT_GOAL := help

check-env:
ifndef LOCALYARN_SRV
	$(error LOCALYARN_SRV env variable not set, should be a destination valid for rsync)
endif
ifndef WEB_SRV_PORT
	$(error WEB_SRV_PORT env variable not set, should be SSH port number for web server)
endif