blob: 06d9bbf3c0c5abb4dcb3d85a1bfbde93493943da (
about) (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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
50
51
52
53
54
55
56
57
58
59
60
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
|
.POSIX:
default: all
include generated.mk
.SUFFIXES:
.SUFFIXES: .md .content .conf .html .xmlentry
.md.content:
awk 'sep >= 2; /^---$$/ {sep++}' < $< > $@
.md.conf:
conf $< > $@
.md.html:
html $< > $@
.md.xmlentry:
xmlentry $< > $@
derived-assets = \
$(all-generated) \
$(feeds) \
all: public
$(all-generated.conf) $(all-generated.content): $(non-content)
$(all-generated.conf): src/lib/base.conf
$(all-generated.xml):
feed $@
clean:
rm -rf \
public/ $(derived-assets) *.sentinel generated.mk po/po4a.cfg \
src/content/*/*.html.*.txt src/content/*/*/*.html.*.txt \
src/content/*/*/*.sortdata src/content/**/feeds/ \
public: $(derived-assets) symlink-mappings.sentinel copy-content.sentinel copy-code-snippets.sentinel
content = \
$(all-generated.html) \
$(all-generated.xml) \
$(static-content) \
symlink-mappings.sentinel: src/redirect.mappings content-mkdir.sentinel
< src/redirect.mappings \
awk '{ printf "ln -rfs public/%s public/%s\n", $$2, $$1 }' | \
sh
touch $@
copy-content.sentinel: $(content) content-mkdir.sentinel
echo $? | tr ' ' '\n' | grep '^src/content/' | sed 's|^src/content/||' | \
xargs -P`nproc` -I% ln -f src/content/% public/%
touch $@
copy-code-snippets.sentinel: $(all-generated.snippets) content-mkdir.sentinel
echo $? | tr ' ' '\n' | grep '^src/content/' | \
xargs sed 's|^src/content/||' | \
xargs -P`nproc` -I% ln -f src/content/% public/%
touch $@
content-mkdir.sentinel: $(content) $(all-generated.snippets) src/redirect.mappings
echo $? | tr ' ' '\n' | grep '^src/content/' | sed 's|^src/content/||' | \
printf '%s\n%s\n' "`cat -`" "`awk '{print $$2}' src/redirect.mappings`" | \
xargs dirname | \
sort | \
uniq | \
xargs -P`nproc` -I% mkdir -p public/%
touch $@
src/content/favicon.ico: src/content/favicon.svg
convert src/content/favicon.svg $@
src/content/public.asc.txt:
gpg --armour --export '$(EMAIL)' > $@
src/content/.well-known/security.txt: src/content/public.asc.txt src/bin/security-txt
security-txt > $@
test-files = \
aux/checks/shellcheck.sh \
aux/checks/todos.sh \
$(test-files): ALWAYS
sh $@
check: $(test-files)
dev: all check
run: all
serve -d public/
upload: public
rsync \
--rsync-path='sudo -u deployer rsync' \
-avzP \
--delete \
--exclude 's/*' \
public/ $(DOMAIN):/srv/www/
ALWAYS:
|