forked from yurivict/crate
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
424 lines (378 loc) · 18.5 KB
/
Copy pathMakefile
File metadata and controls
424 lines (378 loc) · 18.5 KB
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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
# --- Source files ---
LIB_SRCS = lib/spec.cpp lib/spec_pure.cpp lib/create.cpp lib/run.cpp \
lib/list.cpp lib/info.cpp lib/clean.cpp lib/console.cpp \
lib/export.cpp lib/import.cpp lib/import_pure.cpp \
lib/gui.cpp lib/run_net.cpp lib/run_jail.cpp lib/run_gui.cpp \
lib/run_services.cpp lib/locs.cpp lib/cmd.cpp lib/mount.cpp \
lib/net.cpp lib/ctx.cpp lib/gui_registry.cpp lib/scripts.cpp \
lib/misc.cpp lib/util.cpp lib/util_pure.cpp lib/err.cpp \
lib/validate.cpp lib/validate_pure.cpp \
lib/snapshot.cpp lib/config.cpp \
lib/scripts_pure.cpp lib/run_pure.cpp lib/autoname_pure.cpp \
lib/auth_pure.cpp lib/list_pure.cpp lib/run_gui_pure.cpp \
lib/compositor_pure.cpp \
lib/snapshot_pure.cpp lib/crypto_pure.cpp lib/log_pure.cpp \
lib/sign_pure.cpp lib/audit.cpp lib/audit_pure.cpp \
lib/pool_pure.cpp lib/warm_pure.cpp lib/warm.cpp \
lib/retune_pure.cpp lib/retune.cpp \
lib/privops_pure.cpp lib/privops_wire_pure.cpp \
lib/privops_nv_pure.cpp lib/privops_authz_pure.cpp \
lib/jid_owner_registry_pure.cpp lib/jid_owner_registry.cpp \
lib/privops_client_pure.cpp lib/privops_client.cpp \
lib/runtime_paths_pure.cpp lib/per_user_net_pure.cpp \
lib/per_user_rctl_pure.cpp lib/per_user_env_pure.cpp \
lib/audit_per_user_pure.cpp \
lib/throttle_pure.cpp lib/throttle.cpp \
lib/doctor_pure.cpp lib/doctor.cpp \
lib/vmwrap_pure.cpp lib/vmwrap.cpp \
lib/ip_alloc_pure.cpp lib/network_lease.cpp \
lib/ip6_alloc_pure.cpp lib/network_lease6.cpp \
lib/spec_registry_pure.cpp lib/spec_registry.cpp \
lib/zfs_dataset_pure.cpp lib/zfs_dataset.cpp \
lib/update.cpp \
lib/auto_fw_pure.cpp \
lib/net_detect_pure.cpp lib/net_detect.cpp \
lib/share_pure.cpp \
lib/top_pure.cpp lib/top.cpp \
lib/bridge_pure.cpp \
lib/inter_dns_pure.cpp lib/inter_dns.cpp \
lib/wireguard_pure.cpp lib/ipsec_pure.cpp lib/vpn.cpp \
lib/wireguard_runtime_pure.cpp lib/ipsec_runtime_pure.cpp \
lib/migrate_pure.cpp lib/migrate.cpp \
lib/backup_pure.cpp lib/backup.cpp \
lib/backup_prune_pure.cpp lib/backup_prune.cpp \
lib/replicate_pure.cpp lib/replicate.cpp \
lib/inspect_pure.cpp lib/inspect.cpp \
lib/stack.cpp lib/stack_pure.cpp \
lib/jail_query.cpp lib/zfs_ops.cpp lib/ifconfig_ops.cpp \
lib/pfctl_ops.cpp lib/mac_ops.cpp lib/ipfw_ops.cpp \
lib/capsicum_ops.cpp lib/netgraph_ops.cpp lib/nv_protocol.cpp \
lib/lifecycle.cpp lib/lifecycle_pure.cpp
CLI_SRCS = cli/main.cpp cli/args.cpp cli/args_pure.cpp
DAEMON_SRCS = daemon/main.cpp daemon/config.cpp daemon/server.cpp \
daemon/routes.cpp daemon/routes_pure.cpp daemon/auth.cpp \
daemon/metrics.cpp daemon/metrics_pure.cpp \
daemon/ws_pure.cpp daemon/ws_console.cpp \
daemon/transfer_pure.cpp \
daemon/control_socket_pure.cpp daemon/control_socket.cpp \
daemon/sandbox_pure.cpp daemon/sandbox.cpp \
daemon/rate_limit_pure.cpp daemon/rate_limit.cpp \
daemon/socket_perms_pure.cpp \
daemon/privops_handlers.cpp \
daemon/audit_per_user.cpp \
daemon/privops_listener.cpp
SNMPD_SRCS = snmpd/main.cpp snmpd/collector.cpp \
snmpd/mib.cpp snmpd/mib_pure.cpp
LIB_OBJS = $(LIB_SRCS:.cpp=.o)
CLI_OBJS = $(CLI_SRCS:.cpp=.o)
DAEMON_OBJS = $(DAEMON_SRCS:.cpp=.o)
SNMPD_OBJS = $(SNMPD_SRCS:.cpp=.o)
# --- Flags ---
PREFIX ?= /usr/local
CXXFLAGS += `pkg-config --cflags yaml-cpp`
LDFLAGS += `pkg-config --libs yaml-cpp`
LIBS += -ljail -lnetgraph -lmd -lpthread -lnv
# Optional native API support (fallback to shell commands if not defined)
ifdef HAVE_LIBZFS
CXXFLAGS += -DHAVE_LIBZFS
LIBS += -lzfs -lzfs_core -lnvpair
endif
ifdef HAVE_LIBIFCONFIG
CXXFLAGS += -DHAVE_LIBIFCONFIG
LIBS += -lifconfig
endif
ifdef HAVE_LIBPFCTL
CXXFLAGS += -DHAVE_LIBPFCTL
LIBS += -lpfctl
endif
ifdef HAVE_CAPSICUM
CXXFLAGS += -DHAVE_CAPSICUM
LIBS += -lcasper -lcap_dns -lcap_syslog
endif
ifdef WITH_LIBVIRT
CXXFLAGS += -DHAVE_LIBVIRT
LIB_SRCS += lib/vm_spec.cpp lib/vm_run.cpp lib/vm_stack.cpp
LIBS += -lvirt
endif
ifdef WITH_LIBVNCSERVER
CXXFLAGS += -DHAVE_LIBVNCSERVER
LIBS += -lvncserver
endif
# 0.8.22: vnc_server.cpp is always compiled. Internal #ifdef
# HAVE_LIBVNCSERVER stubs out the libvncserver-specific code so
# VncServer::available() returns false on builds without libvncserver
# and lib/run_gui.cpp's `gui.vnc_native: true` path falls back to
# fork+exec'ing x11vnc with an operator-visible warning.
LIB_SRCS += lib/vnc_server.cpp
ifdef WITH_X11
CXXFLAGS += -DHAVE_X11
LIBS += -lX11 -lXrandr -lXext
endif
# 0.8.36: x11_ops.cpp is always compiled. Internal #ifdef HAVE_X11
# guards stub out the libX11-specific code so X11Ops::available()
# returns false on non-WITH_X11 builds and lib/gui.cpp's screenshot
# path falls back to the xwd + xwdtopnm + pnmtopng pipeline.
LIB_SRCS += lib/x11_ops.cpp
ifdef WITH_LIBSEAT
CXXFLAGS += -DHAVE_LIBSEAT
LIBS += -lseat
endif
# 0.8.23: drm_session.cpp is always compiled. Internal #ifdef
# HAVE_LIBSEAT guards stub out the libseat-specific code so
# DrmSession::available() returns false on builds without libseat
# and probeDevice falls back to a plain open(O_RDWR) probe.
LIB_SRCS += lib/drm_session.cpp
CXXFLAGS += -Wall -std=c++17
CXXFLAGS += -Ilib # lib/ headers visible to all
CXXFLAGS += -Idaemon # daemon/ headers for daemon build
CXXFLAGS += -Isnmpd # snmpd/ headers for snmpd build
LIBS_DAEMON = $(LIBS) -lssl -lcrypto -lpthread
# --- Targets ---
all: crate
all-daemon: crate crated
all-snmpd: crate crate-snmpd
libcrate.a: $(LIB_OBJS)
$(AR) rcs $@ $^
crate: libcrate.a $(CLI_OBJS)
$(CXX) $(LDFLAGS) -o $@ $(CLI_OBJS) libcrate.a $(LIBS)
crated: libcrate.a $(DAEMON_OBJS)
$(CXX) $(LDFLAGS) -o $@ $(DAEMON_OBJS) libcrate.a $(LIBS_DAEMON)
crate-snmpd: libcrate.a $(SNMPD_OBJS)
$(CXX) $(LDFLAGS) -o $@ $(SNMPD_OBJS) libcrate.a $(LIBS) -lpthread
install: crate
@mkdir -p $(DESTDIR)$(PREFIX)/bin
@mkdir -p $(DESTDIR)$(PREFIX)/man/man5
# 1.0.0: setuid bit removed. crate(1) runs as the operator and
# delegates privileged operations to crated(8) via the libnv
# privops socket (or HTTPS API for remote clients). Operators
# rolling back to the legacy setuid model can pin to 0.9.30 or
# patch this line back to `-m 04755` — but see docs/rootless-
# migration.md "What the daemon takes over" for the security
# rationale.
install -s -m 0755 crate $(DESTDIR)$(PREFIX)/bin
gzip -9 < crate.5 > $(DESTDIR)$(PREFIX)/man/man5/crate.5.gz
install-daemon: crated
@mkdir -p $(DESTDIR)$(PREFIX)/sbin
@mkdir -p $(DESTDIR)$(PREFIX)/etc/rc.d
@mkdir -p $(DESTDIR)$(PREFIX)/man/man8
install -s -m 0755 crated $(DESTDIR)$(PREFIX)/sbin/crated
install -m 0555 daemon/crated.rc $(DESTDIR)$(PREFIX)/etc/rc.d/crated
install -m 0640 daemon/crated.conf.sample $(DESTDIR)$(PREFIX)/etc/crated.conf.sample
@if [ ! -f $(DESTDIR)$(PREFIX)/etc/crated.conf ]; then \
install -m 0640 daemon/crated.conf.sample $(DESTDIR)$(PREFIX)/etc/crated.conf; \
fi
gzip -9 < crated.8 > $(DESTDIR)$(PREFIX)/man/man8/crated.8.gz
install-local: crate.x
install-examples:
@mkdir -p $(DESTDIR)$(PREFIX)/share/examples/crate/broken
@mkdir -p $(DESTDIR)$(PREFIX)/share/examples/crate/matrix
@find examples -type f | while read f; do \
install -m 644 "$$f" $(DESTDIR)$(PREFIX)/share/examples/crate/$${f#examples/}; \
done
install-completions:
@mkdir -p $(DESTDIR)$(PREFIX)/share/crate/completions
install -m 644 completions/crate.sh $(DESTDIR)$(PREFIX)/share/crate/completions/crate.sh
crate.x: crate
sudo install -s -m 04755 -o 0 -g 0 crate crate.x
install-snmpd: crate-snmpd
install -s -m 0755 crate-snmpd $(DESTDIR)$(PREFIX)/sbin/crate-snmpd
@mkdir -p $(DESTDIR)$(PREFIX)/share/snmp/mibs
install -m 0644 snmpd/CRATE-MIB.txt $(DESTDIR)$(PREFIX)/share/snmp/mibs/CRATE-MIB.txt
# Install only the crate-hub(8) man page. The hub binary itself is
# built and installed separately (its build is not driven from this
# Makefile yet). Splitting this target out lets the hub package — or
# an operator running `make install-hub-man` by hand — ship the
# documentation without otherwise touching the source tree.
install-hub-man:
@mkdir -p $(DESTDIR)$(PREFIX)/man/man8
gzip -9 < crate-hub.8 > $(DESTDIR)$(PREFIX)/man/man8/crate-hub.8.gz
UNIT_TESTS = util_test spec_test spec_netopt_test lifecycle_test \
network_test network_ipv6_test err_test \
snmpd_mib_test daemon_metrics_test stack_test \
util_security_test import_test cli_args_test \
args_validate_test util_subst_test spec_subst_test \
scripts_test adversarial_test spec_validate_test \
validate_pure_test run_pure_test autoname_test \
auth_pure_test list_pure_test run_gui_pure_test \
compositor_pure_test \
snapshot_pure_test crypto_pure_test log_pure_test \
sign_pure_test audit_pure_test share_pure_test \
routes_pure_test top_pure_test bridge_pure_test \
ws_pure_test transfer_pure_test snmpd_agentx_test \
hub_aggregator_pure_test inter_dns_pure_test \
wireguard_pure_test ipsec_pure_test inspect_pure_test \
wireguard_runtime_pure_test migrate_pure_test \
datacenter_pure_test backup_pure_test replicate_pure_test \
ha_pure_test pool_pure_test warm_pure_test \
retune_pure_test throttle_pure_test \
privops_pure_test privops_wire_pure_test \
privops_nv_pure_test privops_client_pure_test \
privops_authz_pure_test \
jid_owner_registry_pure_test \
runtime_paths_pure_test per_user_net_pure_test \
per_user_rctl_pure_test per_user_env_pure_test \
audit_per_user_pure_test \
backup_prune_pure_test control_socket_pure_test \
doctor_pure_test sandbox_pure_test rate_limit_pure_test \
ip_alloc_pure_test auto_fw_pure_test \
ipsec_runtime_pure_test net_detect_pure_test \
vmwrap_pure_test socket_perms_pure_test \
ip6_alloc_pure_test spec_registry_pure_test \
zfs_dataset_pure_test hub_scheduling_pure_test
UNIT_TEST_BINS = $(addprefix tests/unit/,$(UNIT_TESTS))
test: $(UNIT_TEST_BINS)
cd tests && kyua test
# test-unit: run only the unit test suite (no functional tests).
# Handy for local development on Linux where functional/crate_info_test
# requires a FreeBSD jail and will otherwise be reported as broken.
test-unit: $(UNIT_TEST_BINS)
cd tests && kyua test unit
# build-unit-tests: build every unit test binary without running anything.
# Useful in CI where the build runs as a regular user but kyua must run
# with elevated privileges (FreeBSD jail tests).
build-unit-tests: $(UNIT_TEST_BINS)
# Pure platform-independent sources tests can safely link against.
# Compiled into per-source object files under TEST_OBJ_DIR ONCE per
# clean build, then linked into every UNIT_TEST_BINS target. Before
# 0.7.12 these were inline-compiled per test (~30 srcs * ~40 tests
# = ~1200 compiles); now it's ~30 + 40 = 70. The .o files live in
# their own dir so they don't collide with the main lib/*.o build
# (which uses different CXXFLAGS for the production crate binary).
TEST_OBJ_DIR = tests/unit/.test-objs
TEST_LINK_SRCS = lib/util_pure.cpp lib/err.cpp \
lib/spec_pure.cpp lib/stack_pure.cpp \
lib/lifecycle_pure.cpp lib/import_pure.cpp \
lib/scripts_pure.cpp lib/validate_pure.cpp \
lib/run_pure.cpp lib/autoname_pure.cpp \
lib/auth_pure.cpp lib/list_pure.cpp lib/run_gui_pure.cpp \
lib/compositor_pure.cpp \
lib/snapshot_pure.cpp lib/crypto_pure.cpp lib/log_pure.cpp \
lib/sign_pure.cpp lib/audit_pure.cpp lib/pool_pure.cpp \
lib/warm_pure.cpp lib/retune_pure.cpp \
lib/privops_pure.cpp lib/privops_wire_pure.cpp \
lib/privops_nv_pure.cpp lib/privops_authz_pure.cpp \
lib/jid_owner_registry_pure.cpp \
lib/privops_client_pure.cpp \
lib/runtime_paths_pure.cpp lib/per_user_net_pure.cpp \
lib/per_user_rctl_pure.cpp lib/per_user_env_pure.cpp \
lib/audit_per_user_pure.cpp \
lib/throttle_pure.cpp lib/doctor_pure.cpp \
lib/vmwrap_pure.cpp \
lib/ip_alloc_pure.cpp lib/ip6_alloc_pure.cpp \
lib/spec_registry_pure.cpp \
lib/zfs_dataset_pure.cpp \
lib/auto_fw_pure.cpp \
lib/net_detect_pure.cpp \
lib/share_pure.cpp lib/top_pure.cpp lib/bridge_pure.cpp \
lib/inter_dns_pure.cpp lib/wireguard_pure.cpp \
lib/ipsec_pure.cpp lib/inspect_pure.cpp \
lib/wireguard_runtime_pure.cpp lib/ipsec_runtime_pure.cpp \
lib/migrate_pure.cpp \
lib/backup_pure.cpp lib/backup_prune_pure.cpp \
lib/replicate_pure.cpp \
cli/args_pure.cpp daemon/metrics_pure.cpp \
daemon/routes_pure.cpp daemon/ws_pure.cpp \
daemon/transfer_pure.cpp daemon/control_socket_pure.cpp \
daemon/sandbox_pure.cpp daemon/rate_limit_pure.cpp \
daemon/socket_perms_pure.cpp \
hub/aggregator_pure.cpp \
hub/datacenter_pure.cpp hub/ha_pure.cpp \
hub/scheduling_pure.cpp \
snmpd/mib_pure.cpp
# Map every src to a .o under TEST_OBJ_DIR keeping the source's
# directory layout (lib/foo.cpp -> tests/unit/.test-objs/lib/foo.o).
TEST_LINK_OBJS = $(patsubst %.cpp,$(TEST_OBJ_DIR)/%.o,$(TEST_LINK_SRCS))
TEST_STUB_OBJ = $(TEST_OBJ_DIR)/tests/unit/_test_config_stub.o
# -Icli/-Idaemon/-Isnmpd let tests #include the *_pure.h files directly.
TEST_INCLUDES = -Ilib -Icli -Idaemon -Isnmpd -Ihub
# Per-source compile rule for everything reachable via TEST_LINK_SRCS
# and the test-config stub. The mkdir -p $(@D) handles all the
# nested subdirs (lib/, daemon/, cli/, hub/, snmpd/, tests/unit/)
# without us needing N rules.
#
# .SECONDARY tells make these objects are NOT intermediate, so they
# survive the build instead of being deleted after the test binary
# links — critical for incremental rebuilds (`make build-unit-tests`
# twice in a row should be a no-op, not 30 recompiles).
#
# -MMD -MP emits per-object dependency files (.d) tracking every
# header the .cpp pulls in. We include them at the bottom so a
# header change (e.g. lib/args.h) triggers a recompile of every
# object that #include's it. Without this, 0.7.16 would silently
# build against a stale args.h and tests would fail with
# "validate() did not throw" because the object knows about an
# older Args layout.
.SECONDARY: $(TEST_LINK_OBJS) $(TEST_STUB_OBJ)
$(TEST_OBJ_DIR)/%.o: %.cpp lib/lst-all-script-sections.h
@mkdir -p $(@D)
$(CXX) -std=c++17 $(TEST_INCLUDES) $(COVERAGE_CXXFLAGS) -MMD -MP -c $< -o $@
# Test binary: compile its own .cpp inline (one source -> one
# binary), link against the cached TEST_LINK_OBJS + stub. The .cpp
# is compiled at link time here (single -o $@ $< ...). Header
# dependencies for that compile are NOT tracked by .d (no separate
# .o), but tests/unit/*.cpp is small per file and fast to recompile.
tests/unit/%: tests/unit/%.cpp $(TEST_LINK_OBJS) $(TEST_STUB_OBJ) lib/lst-all-script-sections.h
$(CXX) -std=c++17 $(TEST_INCLUDES) $(COVERAGE_CXXFLAGS) -o $@ $< $(TEST_LINK_OBJS) $(TEST_STUB_OBJ) $(COVERAGE_LDFLAGS) -L/usr/local/lib -latf-c++ -latf-c
# Auto-generated header dependency files. The leading `-` makes make
# tolerate them not yet existing (first build); after the first
# compile of each .cpp, its .d is created and subsequent runs see
# the proper header chain.
-include $(TEST_LINK_OBJS:.o=.d)
-include $(TEST_STUB_OBJ:.o=.d)
# coverage: build unit tests with gcov instrumentation, run them, and
# render an HTML report under coverage-html/. Requires lcov + genhtml.
#
# Usage:
# gmake coverage # build, run, report
# gmake coverage-clean # remove .gcda/.gcno + report
#
# Note: tests currently embed local copies of the functions under test
# (see tests/unit/*.cpp). gcov measures coverage of those *test-local*
# copies — useful for spotting un-exercised branches in test logic, less
# useful as production-code coverage. A future change to link tests
# against libcrate.a would make this report fully accurate.
COVERAGE_CXXFLAGS ?=
COVERAGE_LDFLAGS ?=
coverage: clean-tests
@$(MAKE) COVERAGE_CXXFLAGS="-O0 -g --coverage -fprofile-arcs -ftest-coverage" \
COVERAGE_LDFLAGS="--coverage" \
build-unit-tests
cd tests && kyua test unit || true
@command -v lcov >/dev/null 2>&1 || { echo "lcov not installed: apt install lcov / pkg install lcov"; exit 1; }
@command -v genhtml >/dev/null 2>&1 || { echo "genhtml not installed (ships with lcov)"; exit 1; }
lcov --capture --directory tests/unit --output-file coverage.info \
--rc geninfo_unexecuted_blocks=1 \
--ignore-errors source,inconsistent,mismatch,negative
lcov --remove coverage.info '/usr/*' '*/atf-c++.hpp' \
--output-file coverage.info \
--ignore-errors unused
genhtml coverage.info --output-directory coverage-html \
--ignore-errors source,inconsistent,corrupt
@echo
@echo " Coverage report: coverage-html/index.html"
coverage-clean:
rm -f coverage.info
rm -rf coverage-html
find tests/unit -name '*.gcda' -delete
find tests/unit -name '*.gcno' -delete
clean-tests:
rm -f $(UNIT_TEST_BINS)
rm -rf $(TEST_OBJ_DIR)
clean: clean-tests coverage-clean
rm -f $(LIB_OBJS) $(CLI_OBJS) $(DAEMON_OBJS) $(SNMPD_OBJS) libcrate.a crate crated crate-snmpd lib/lst-all-script-sections.h
# --- Generated sources ---
lib/lst-all-script-sections.h: lib/create.cpp lib/run.cpp lib/run_net.cpp lib/run_jail.cpp lib/run_gui.cpp lib/run_services.cpp
@(echo "static std::set<std::string> allScriptSections = {\"\"" && \
grep -h "runScript(" lib/create.cpp lib/run.cpp lib/run_net.cpp lib/run_jail.cpp lib/run_gui.cpp lib/run_services.cpp | sed -e 's|.*runScript(|, |; s|);||' && \
echo "};" \
) > $@
@touch lib/spec.cpp
@echo "generate $@"
lib/spec.cpp: lib/lst-all-script-sections.h
# --- Shortcuts ---
a: all
c: clean
d: all-daemon
l: install-local
e: install-examples
s: all-snmpd