blob: 0188a505253b0fbebbe521d02d2f1b80a2b17c78 (
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
|
.POSIX:
DATE = 1970-01-01
VERSION = 0.1.0
NAME = euandre.org
NAME_UC = $(NAME)
LANGUAGES = en
## Installation prefix. Defaults to "/usr".
PREFIX = /usr
BINDIR = $(PREFIX)/bin
LIBDIR = $(PREFIX)/lib
INCLUDEDIR = $(PREFIX)/include
SRCDIR = $(PREFIX)/src/$(NAME)
SHAREDIR = $(PREFIX)/share
LOCALEDIR = $(SHAREDIR)/locale
MANDIR = $(SHAREDIR)/man
DOCDIR = $(SHAREDIR)/doc/$(NAME)
HTMLDIR = $(SHAREDIR)/html/$(NAME)
EXEC = ./
## Where to store the installation. Empty by default.
DESTDIR =
LDLIBS =
.SUFFIXES:
.SUFFIXES: .adoc .conf .snippets .indexentry .feedentry .sortdata .xml .xmldeps
.SUFFIXES: .htmlbody .htmlheader .htmlfooter .htmllisting .html
.adoc.conf:
mkwb conf src/global.conf $< > $@
.adoc.htmlbody:
mkwb htmlbody $< > $@
.htmlbody.html:
mkwb html $< > $@
.conf.htmlheader:
mkwb html -H $< > $@
.conf.htmlfooter:
mkwb html -F $< > $@
.conf.htmllisting:
mkwb indexbody $< > $@
.adoc.snippets:
mkwb snippets $< > $@
.conf.indexentry:
mkwb indexentry $< > $@
.htmlbody.feedentry:
mkwb feedentry $< > $@
.conf.sortdata:
mkwb sortdata $< > $@
all:
include deps.mk
sources.adoc = $(articles.adoc) $(listings.adoc) $(pages.adoc)
sources.htmlbody = $(sources.adoc:.adoc=.htmlbody)
sources.html = $(sources.adoc:.adoc=.html)
sources.snippets = $(sources.adoc:.adoc=.snippets)
sources.conf = $(sources.adoc:.adoc=.conf)
articles.indexentry = $(articles.adoc:.adoc=.indexentry)
articles.feedentry = $(articles.adoc:.adoc=.feedentry)
articles.sortdata = $(articles.adoc:.adoc=.sortdata)
listings.htmlheader = $(listings.adoc:.adoc=.htmlheader)
listings.htmlfooter = $(listings.adoc:.adoc=.htmlfooter)
listings.htmllisting = $(listings.adoc:.adoc=.htmllisting)
listings.htmldeps = $(listings.adoc:.adoc=.htmldeps)
listings.html = $(listings.adoc:.adoc=.html)
feeds.xmldeps = $(feeds.xml:.xml=.xmldeps)
sources = \
$(sources.adoc) \
$(images.svg) \
src/content/style.css \
contents = \
$(sources.html) \
$(feeds.xml) \
static-contents = \
$(sources.extras) \
$(images.svg) \
src/content/style.css \
derived-assets = \
$(contents) \
$(sources.htmlbody) \
$(sources.snippets) \
$(sources.conf) \
src/global.conf \
$(listings.htmlheader) \
$(listings.htmlfooter) \
$(listings.htmllisting) \
$(listings.htmldeps) \
$(feeds.xmldeps) \
$(articles.indexentry) \
$(articles.feedentry) \
$(articles.sortdata) \
side-assets = \
src/collections/*/*/*/*/*.html.*.txt \
src/collections/*/index.html.*.txt \
src/collections/*/*.sortdata \
src/pages/*/*.html.*.txt \
## Default target. Builds all artifacts required for testing
## and installation.
all: $(derived-assets)
$(derived-assets): Makefile deps.mk
$(sources.conf): src/global.conf src/headers.txt
src/global.conf: src/base.conf
mkwb conf -G src/base.conf > $@
$(listings.html):
cat $*.htmlheader $*.htmllisting $*.htmlbody $*.htmlfooter > $@
$(feeds.xml):
mkwb feed src/global.conf $*.xmldeps > $@
check-unit:
integration-tests = \
.PRECIOUS: $(integration-tests)
$(integration-tests): ALWAYS
sh $@
check-integration: $(integration-tests)
## Run all tests. Each test suite is isolated, so that a parallel
## build can run tests at the same time. The required artifacts
## are created if missing.
check: check-unit check-integration
## Remove *all* derived artifacts produced during the build.
## A dedicated test asserts that this is always true.
clean:
rm -rf $(derived-assets) $(side-assets)
## Installs into $(DESTDIR)$(PREFIX). Its dependency target
## ensures that all installable artifacts are crafted beforehand.
install: all
mkdir -p \
'$(DESTDIR)$(SRCDIR)' \
for f in $(contents) $(static-contents) `cat $(sources.snippets)`; do \
dir='$(DESTDIR)$(HTMLDIR)'/"`dirname "$${f#src/content/}"`"; \
mkdir -p "$$dir"; \
cp -P "$$f" "$$dir"; \
done
for f in $(sources); do \
dir='$(DESTDIR)$(SRCDIR)'/"`dirname "$${f#src/content/}"`"; \
mkdir -p "$$dir"; \
cp -P "$$f" "$$dir"; \
done
## Uninstalls from $(DESTDIR)$(PREFIX). This is a perfect mirror
## of the "install" target, and removes *all* that was installed.
## A dedicated test asserts that this is always true.
uninstall:
rm -rf \
'$(DESTDIR)$(SRCDIR)' \
'$(DESTDIR)$(HTMLDIR)' \
PORT = 3333
## Run file server for local installed static files.
run:
serve -n -p $(PORT) -d '$(DESTDIR)$(HTMLDIR)'
ALWAYS:
|