Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
144 lines (118 loc) · 4.12 KB
/
Copy pathMakefile
File metadata and controls
144 lines (118 loc) · 4.12 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
# Makefile — thin convenience wrapper over `nix run .#…` apps.
#
# Linux only. The Nix flake is the source of truth for every build
# action; this Makefile exists so `make setup && make test` is the
# common ergonomic surface. Every recipe shells out to a single
# `nix run` call rather than re-implementing the build steps;
# nothing here is a checked-in shell script.
.DEFAULT_GOAL := help
.PHONY: help setup update dev \
build build-release build-static \
test test-asan test-tsan test-all \
run demo goodnet node \
plugin-new plugin-pull plugin-install plugin-update \
docs livedoc livedoc-check livedoc-test \
clean
help:
@echo "GoodNet — Make wrapper over the Nix flake"
@echo ""
@echo "Setup / refresh:"
@echo " make setup init mirrors + install plugins + hooks"
@echo " make update refresh kernel inputs + plugin pulls"
@echo ""
@echo "Dev / build:"
@echo " make dev enter dev shell (nix develop)"
@echo " make build Debug build (incremental)"
@echo " make build-release Release build"
@echo " make build-static Release build with every plugin linked statically"
@echo ""
@echo "Test:"
@echo " make test vanilla ctest (full suite)"
@echo " make test-asan ASan + UBSan ctest"
@echo " make test-tsan TSan ctest"
@echo " make test-all vanilla + asan + tsan in sequence"
@echo ""
@echo "Run artefacts:"
@echo " make demo two-node Noise-over-TCP quickstart"
@echo " make goodnet ARGS=… operator multicall CLI"
@echo " make node ARGS=… goodnet run alias"
@echo ""
@echo "Plugin lifecycle:"
@echo " make plugin-new KIND=… NAME=… scaffold a fresh plugin"
@echo " make plugin-pull REPO=… clone a single plugin"
@echo " make plugin-install pull every loadable plugin"
@echo " make plugin-update git pull --ff-only each"
@echo ""
@echo "Documentation:"
@echo " make docs Doxygen API ref + diagrams + canvas"
@echo " make livedoc refresh source-derived facts + injections"
@echo " make livedoc-check fail if working tree drifts from sources"
@echo " make livedoc-test unit tests for the livedoc tooling"
@echo ""
@echo "Maintenance:"
@echo " make clean remove build*/ and result/ symlinks"
# Setup / refresh
setup:
nix run .#setup
update:
nix run .#update
# Dev / build
dev:
nix develop
build:
nix run .#build
build-release:
nix run .#build -- release
# Single-binary build: every bundled plugin's `gn_plugin_init`
# entry symbol gets suffix-renamed (`gn_plugin_init_link_tcp`, …)
# so they can all link into the goodnet binary at once.
# `PluginManager::load_static()` iterates the generated registry
# instead of dlopen. Result: one Release binary that ships every
# plugin's implementation (.text) without separate `.so` files.
build-static:
nix run .#build -- static
# Test
test:
nix run .#test
test-asan:
nix run .#test -- asan
test-tsan:
nix run .#test -- tsan
test-all:
nix run .#test -- all
# Run artefacts (ARGS forwarded after --)
run:
nix run .#run -- $(ARGS)
demo:
nix run .#run -- demo
goodnet:
nix run .#run -- goodnet $(ARGS)
node:
nix run .#run -- node $(ARGS)
# Plugin lifecycle
plugin-new:
nix run .#plugin -- new $(KIND) $(NAME)
plugin-pull:
nix run .#plugin -- pull $(REPO)
plugin-install:
nix run .#plugin -- install
plugin-update:
nix run .#plugin -- update
# Documentation
docs:
nix run .#docs
# Livedoc — refresh source-derived facts + diagrams + canvas +
# inject into narrative markdown. Idempotent; commit the diff to
# keep docs in sync with the working tree.
livedoc:
nix develop --command python3 tools/livedoc.py --all
# Same as `livedoc` but exits non-zero if the working tree drifts
# from what the generator would produce. Useful as a CI gate.
livedoc-check:
nix develop --command python3 tools/livedoc.py --check
# Unit test suite for the livedoc Python tooling itself.
livedoc-test:
nix develop --command python3 -m pytest tests/livedoc -v
# Maintenance
clean:
rm -rf build build-* result result-* /tmp/static_v2 /tmp/dyn_release