This repository has been archived by the owner on Feb 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathMakefile
286 lines (260 loc) · 15.8 KB
/
Makefile
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
# All
all: build
# Build
build: \
build-unisockets-runner \
build-net-server-native-posix-go \
build-net-server-native-posix-tinygo \
build-net-server-wasm-jssi-go \
build-net-server-wasm-wasi-tinygo \
build-net-client-native-posix-go \
build-net-client-native-posix-tinygo \
build-net-client-wasm-jssi-go \
build-net-client-wasm-wasi-tinygo \
build-tcp-server-native-posix-go \
build-tcp-server-native-posix-tinygo \
build-tcp-server-wasm-jssi-go \
build-tcp-server-wasm-wasi-tinygo \
build-tcp-client-native-posix-go \
build-tcp-client-native-posix-tinygo \
build-tcp-client-wasm-jssi-go \
build-tcp-client-wasm-wasi-tinygo \
build-softmax-server-native-posix-go \
build-softmax-server-native-posix-tinygo \
build-softmax-server-wasm-jssi-go \
build-softmax-server-wasm-wasi-tinygo \
build-softmax-client-native-posix-go \
build-softmax-client-native-posix-tinygo \
build-softmax-client-wasm-jssi-go \
build-softmax-client-wasm-wasi-tinygo \
build-tinyperf-native-posix-go \
build-tinyperf-wasm-jssi-go
build-unisockets-runner:
@docker build -t alphahorizonio/unisockets-runner -f Dockerfile.unisockets-runner .
build-net-server-native-posix-go:
@docker run -v ${PWD}:/src:z golang sh -c 'cd /src && go build -o out/go/net_echo_server ./cmd/net_echo_server/main.go'
build-net-server-native-posix-tinygo:
@docker run -v ${PWD}:/src:z tinygo/tinygo sh -c 'cd /src && mkdir -p out/tinygo && tinygo build -o out/tinygo/net_echo_server ./cmd/net_echo_server/main.go'
build-net-server-wasm-jssi-go:
@docker run -v ${PWD}:/src:z -e GOOS=js -e GOARCH=wasm golang sh -c 'cd /src && go build -o out/go/net_echo_server.wasm ./cmd/net_echo_server/main.go'
build-net-server-wasm-wasi-tinygo:
@docker run -v ${PWD}:/src:z tinygo/tinygo sh -c 'cd /src && mkdir -p out/tinygo && tinygo build -heap-size 20M -cflags "-DUNISOCKETS_WITH_CUSTOM_ARPA_INET" -target wasi -o out/tinygo/net_echo_server_wasi_original.wasm ./cmd/net_echo_server/main.go'
@docker run -v ${PWD}:/src:z alphahorizonio/wasi-sdk sh -c 'cd /src && wasm-opt --asyncify -O out/tinygo/net_echo_server_wasi_original.wasm -o out/tinygo/net_echo_server_wasi.wasm'
build-net-client-native-posix-go:
@docker run -v ${PWD}:/src:z golang sh -c 'cd /src && go build -o out/go/net_echo_client ./cmd/net_echo_client/main.go'
build-net-client-native-posix-tinygo:
@docker run -v ${PWD}:/src:z tinygo/tinygo sh -c 'cd /src && mkdir -p out/tinygo && tinygo build -o out/tinygo/net_echo_client ./cmd/net_echo_client/main.go'
build-net-client-wasm-jssi-go:
@docker run -v ${PWD}:/src:z -e GOOS=js -e GOARCH=wasm golang sh -c 'cd /src && go build -o out/go/net_echo_client.wasm ./cmd/net_echo_client/main.go'
build-net-client-wasm-wasi-tinygo:
@docker run -v ${PWD}:/src:z tinygo/tinygo sh -c 'cd /src && mkdir -p out/tinygo && tinygo build -heap-size 20M -cflags "-DUNISOCKETS_WITH_CUSTOM_ARPA_INET" -target wasi -o out/tinygo/net_echo_client_wasi_original.wasm ./cmd/net_echo_client/main.go'
@docker run -v ${PWD}:/src:z alphahorizonio/wasi-sdk sh -c 'cd /src && wasm-opt --asyncify -O out/tinygo/net_echo_client_wasi_original.wasm -o out/tinygo/net_echo_client_wasi.wasm'
build-tcp-server-native-posix-go:
@docker run -v ${PWD}:/src:z golang sh -c 'cd /src && go build -o out/go/tcp_echo_server ./cmd/tcp_echo_server/main.go'
build-tcp-server-native-posix-tinygo:
@docker run -v ${PWD}:/src:z tinygo/tinygo sh -c 'cd /src && mkdir -p out/tinygo && tinygo build -o out/tinygo/tcp_echo_server ./cmd/tcp_echo_server/main.go'
build-tcp-server-wasm-jssi-go:
@docker run -v ${PWD}:/src:z -e GOOS=js -e GOARCH=wasm golang sh -c 'cd /src && go build -o out/go/tcp_echo_server.wasm ./cmd/tcp_echo_server/main.go'
build-tcp-server-wasm-wasi-tinygo:
@docker run -v ${PWD}:/src:z tinygo/tinygo sh -c 'cd /src && mkdir -p out/tinygo && tinygo build -heap-size 20M -cflags "-DUNISOCKETS_WITH_CUSTOM_ARPA_INET" -target wasi -o out/tinygo/tcp_echo_server_wasi_original.wasm ./cmd/tcp_echo_server/main.go'
@docker run -v ${PWD}:/src:z alphahorizonio/wasi-sdk sh -c 'cd /src && wasm-opt --asyncify -O out/tinygo/tcp_echo_server_wasi_original.wasm -o out/tinygo/tcp_echo_server_wasi.wasm'
build-tcp-client-native-posix-go:
@docker run -v ${PWD}:/src:z golang sh -c 'cd /src && go build -o out/go/tcp_echo_client ./cmd/tcp_echo_client/main.go'
build-tcp-client-native-posix-tinygo:
@docker run -v ${PWD}:/src:z tinygo/tinygo sh -c 'cd /src && mkdir -p out/tinygo && tinygo build -o out/tinygo/tcp_echo_client ./cmd/tcp_echo_client/main.go'
build-tcp-client-wasm-jssi-go:
@docker run -v ${PWD}:/src:z -e GOOS=js -e GOARCH=wasm golang sh -c 'cd /src && go build -o out/go/tcp_echo_client.wasm ./cmd/tcp_echo_client/main.go'
build-tcp-client-wasm-wasi-tinygo:
@docker run -v ${PWD}:/src:z tinygo/tinygo sh -c 'cd /src && mkdir -p out/tinygo && tinygo build -heap-size 20M -cflags "-DUNISOCKETS_WITH_CUSTOM_ARPA_INET" -target wasi -o out/tinygo/tcp_echo_client_wasi_original.wasm ./cmd/tcp_echo_client/main.go'
@docker run -v ${PWD}:/src:z alphahorizonio/wasi-sdk sh -c 'cd /src && wasm-opt --asyncify -O out/tinygo/tcp_echo_client_wasi_original.wasm -o out/tinygo/tcp_echo_client_wasi.wasm'
build-softmax-server-native-posix-go:
@docker run -v ${PWD}:/src:z golang sh -c 'cd /src && go build -o out/go/softmax_server ./cmd/softmax_server/main.go'
build-softmax-server-native-posix-tinygo:
@docker run -v ${PWD}:/src:z tinygo/tinygo sh -c 'cd /src && mkdir -p out/tinygo && tinygo build -o out/tinygo/softmax_server ./cmd/softmax_server/main.go'
build-softmax-server-wasm-jssi-go:
@docker run -v ${PWD}:/src:z -e GOOS=js -e GOARCH=wasm golang sh -c 'cd /src && go build -o out/go/softmax_server.wasm ./cmd/softmax_server/main.go'
build-softmax-server-wasm-wasi-tinygo:
@docker run -v ${PWD}:/src:z tinygo/tinygo sh -c 'cd /src && mkdir -p out/tinygo && tinygo build -heap-size 20M -cflags "-DUNISOCKETS_WITH_CUSTOM_ARPA_INET" -target wasi -o out/tinygo/softmax_server_wasi_original.wasm ./cmd/softmax_server/main.go'
@docker run -v ${PWD}:/src:z alphahorizonio/wasi-sdk sh -c 'cd /src && wasm-opt --asyncify -O out/tinygo/softmax_server_wasi_original.wasm -o out/tinygo/softmax_server_wasi.wasm'
build-softmax-client-native-posix-go:
@docker run -v ${PWD}:/src:z golang sh -c 'cd /src && go build -o out/go/softmax_client ./cmd/softmax_client/main.go'
build-softmax-client-native-posix-tinygo:
@docker run -v ${PWD}:/src:z tinygo/tinygo sh -c 'cd /src && mkdir -p out/tinygo && tinygo build -o out/tinygo/softmax_client ./cmd/softmax_client/main.go'
build-softmax-client-wasm-jssi-go:
@docker run -v ${PWD}:/src:z -e GOOS=js -e GOARCH=wasm golang sh -c 'cd /src && go build -o out/go/softmax_client.wasm ./cmd/softmax_client/main.go'
build-softmax-client-wasm-wasi-tinygo:
@docker run -v ${PWD}:/src:z tinygo/tinygo sh -c 'cd /src && mkdir -p out/tinygo && tinygo build -heap-size 20M -cflags "-DUNISOCKETS_WITH_CUSTOM_ARPA_INET" -target wasi -o out/tinygo/softmax_client_wasi_original.wasm ./cmd/softmax_client/main.go'
@docker run -v ${PWD}:/src:z alphahorizonio/wasi-sdk sh -c 'cd /src && wasm-opt --asyncify -O out/tinygo/softmax_client_wasi_original.wasm -o out/tinygo/softmax_client_wasi.wasm'
build-tinyperf-native-posix-go:
@docker run -v ${PWD}:/src:z golang sh -c 'cd /src && go build -o out/go/tinyperf ./cmd/tinyperf/main.go'
build-tinyperf-wasm-jssi-go:
@docker run -v ${PWD}:/src:z -e GOOS=js -e GOARCH=wasm golang sh -c 'cd /src && go build -o out/go/tinyperf.wasm ./cmd/tinyperf/main.go'
# Clean
clean: \
clean-net-server-native-posix-go \
clean-net-server-native-posix-tinygo \
clean-net-server-wasm-jssi-go \
clean-net-server-wasm-wasi-tinygo \
clean-net-client-native-posix-go \
clean-net-client-native-posix-tinygo \
clean-net-client-wasm-jssi-go \
clean-net-client-wasm-wasi-tinygo \
clean-tcp-server-native-posix-go \
clean-tcp-server-native-posix-tinygo \
clean-tcp-server-wasm-jssi-go \
clean-tcp-server-wasm-wasi-tinygo \
clean-tcp-client-native-posix-go \
clean-tcp-client-native-posix-tinygo \
clean-tcp-client-wasm-jssi-go \
clean-tcp-client-wasm-wasi-tinygo \
clean-softmax-server-native-posix-go \
clean-softmax-server-native-posix-tinygo \
clean-softmax-server-wasm-jssi-go \
clean-softmax-server-wasm-wasi-tinygo \
clean-softmax-client-native-posix-go \
clean-softmax-client-native-posix-tinygo \
clean-softmax-client-wasm-jssi-go \
clean-softmax-client-wasm-wasi-tinygo \
clean-tinyperf-native-posix-go \
clean-tinyperf-wasm-jssi-go
clean-net-server-native-posix-go:
@rm -f out/go/net_echo_server
clean-net-server-native-posix-tinygo:
@rm -f out/tinygo/net_echo_server
clean-net-server-wasm-jssi-go:
@rm -f out/go/net_echo_server.wasm
clean-net-server-wasm-wasi-tinygo:
@rm -f out/tinygo/net_echo_server_wasi_original.wasm
@rm -f out/tinygo/net_echo_server_wasi.wasm
clean-net-client-native-posix-go:
@rm -f out/go/net_echo_client
clean-net-client-native-posix-tinygo:
@rm -f out/tinygo/net_echo_client
clean-net-client-wasm-jssi-go:
@rm -f out/go/net_echo_client.wasm
clean-net-client-wasm-wasi-tinygo:
@rm -f out/tinygo/net_echo_client_wasi_original.wasm
@rm -f out/tinygo/net_echo_client_wasi.wasm
clean-tcp-server-native-posix-go:
@rm -f out/go/tcp_echo_server
clean-tcp-server-native-posix-tinygo:
@rm -f out/tinygo/tcp_echo_server
clean-tcp-server-wasm-jssi-go:
@rm -f out/go/tcp_echo_server.wasm
clean-tcp-server-wasm-wasi-tinygo:
@rm -f out/tinygo/tcp_echo_server_wasi_original.wasm
@rm -f out/tinygo/tcp_echo_server_wasi.wasm
clean-tcp-client-native-posix-go:
@rm -f out/go/tcp_echo_client
clean-tcp-client-native-posix-tinygo:
@rm -f out/tinygo/tcp_echo_client
clean-tcp-client-wasm-jssi-go:
@rm -f out/go/tcp_echo_client.wasm
clean-tcp-client-wasm-wasi-tinygo:
@rm -f out/tinygo/tcp_echo_client_wasi_original.wasm
@rm -f out/tinygo/tcp_echo_client_wasi.wasm
clean-softmax-server-native-posix-go:
@rm -f out/go/softmax_server
clean-softmax-server-native-posix-tinygo:
@rm -f out/tinygo/softmax_server
clean-softmax-server-wasm-jssi-go:
@rm -f out/go/softmax_server.wasm
clean-softmax-server-wasm-wasi-tinygo:
@rm -f out/tinygo/softmax_server_wasi_original.wasm
@rm -f out/tinygo/softmax_server_wasi.wasm
clean-softmax-client-native-posix-go:
@rm -f out/go/softmax_client
clean-softmax-client-native-posix-tinygo:
@rm -f out/tinygo/softmax_client
clean-softmax-client-wasm-jssi-go:
@rm -f out/go/softmax_client.wasm
clean-softmax-client-wasm-wasi-tinygo:
@rm -f out/tinygo/softmax_client_wasi_original.wasm
@rm -f out/tinygo/softmax_client_wasi.wasm
clean-tinyperf-native-posix-go:
@rm -f out/go/tinyperf
clean-tinyperf-wasm-jssi-go:
@rm -f out/go/tinyperf.wasm
# Run
run: \
run-signaling-server \
run-net-server-native-posix-go \
run-net-server-native-posix-tinygo \
run-net-server-wasm-jssi-go \
run-net-server-wasm-wasi-tinygo \
run-net-client-native-posix-go \
run-net-client-native-posix-tinygo \
run-net-client-wasm-jssi-go \
run-net-client-wasm-wasi-tinygo \
run-tcp-server-native-posix-go \
run-tcp-server-native-posix-tinygo \
run-tcp-server-wasm-jssi-go \
run-tcp-server-wasm-wasi-tinygo \
run-tcp-client-native-posix-go \
run-tcp-client-native-posix-tinygo \
run-tcp-client-wasm-jssi-go \
run-tcp-client-wasm-wasi-tinygo \
run-softmax-server-native-posix-go \
run-softmax-server-native-posix-tinygo \
run-softmax-server-wasm-jssi-go \
run-softmax-server-wasm-wasi-tinygo \
run-softmax-client-native-posix-go \
run-softmax-client-native-posix-tinygo \
run-softmax-client-wasm-jssi-go \
run-softmax-client-wasm-wasi-tinygo \
run-tinyperf-native-posix-go \
run-tinyperf-wasm-jssi-go
run-signaling-server: build-unisockets-runner
@docker run --net host -v ${PWD}:/src:z alphahorizonio/unisockets-runner sh -c 'cd /src && unisockets_runner --runSignalingServer true'
run-net-server-native-posix-go:
@./out/go/net_echo_server
run-net-server-native-posix-tinygo:
@./out/tinygo/net_echo_server
run-net-server-wasm-jssi-go: build-unisockets-runner
@docker run --net host -v ${PWD}:/src:z alphahorizonio/unisockets-runner sh -c 'cd /src && unisockets_runner --runBinary true --useGo true --useJSSI true --binaryPath ./out/go/net_echo_server.wasm'
run-net-server-wasm-wasi-tinygo: build-unisockets-runner
@docker run --net host -v ${PWD}:/src:z alphahorizonio/unisockets-runner sh -c 'cd /src && unisockets_runner --runBinary true --useTinyGo true --useWASI true --binaryPath ./out/tinygo/net_echo_server_wasi.wasm'
run-net-client-native-posix-go:
@./out/go/net_echo_client
run-net-client-native-posix-tinygo:
@./out/tinygo/net_echo_client
run-net-client-wasm-jssi-go: build-unisockets-runner
@docker run --net host -v ${PWD}:/src:z alphahorizonio/unisockets-runner sh -c 'cd /src && unisockets_runner --runBinary true --useGo true --useJSSI true --binaryPath ./out/go/net_echo_client.wasm'
run-net-client-wasm-wasi-tinygo: build-unisockets-runner
@docker run --net host -v ${PWD}:/src:z alphahorizonio/unisockets-runner sh -c 'cd /src && unisockets_runner --runBinary true --useTinyGo true --useWASI true --binaryPath ./out/tinygo/net_echo_client_wasi.wasm'
run-tcp-server-native-posix-go:
@./out/go/tcp_echo_server
run-tcp-server-native-posix-tinygo:
@./out/tinygo/tcp_echo_server
run-tcp-server-wasm-jssi-go: build-unisockets-runner
@docker run --net host -v ${PWD}:/src:z alphahorizonio/unisockets-runner sh -c 'cd /src && unisockets_runner --runBinary true --useGo true --useJSSI true --binaryPath ./out/go/tcp_echo_server.wasm'
run-tcp-server-wasm-wasi-tinygo: build-unisockets-runner
@docker run --net host -v ${PWD}:/src:z alphahorizonio/unisockets-runner sh -c 'cd /src && unisockets_runner --runBinary true --useTinyGo true --useWASI true --binaryPath ./out/tinygo/tcp_echo_server_wasi.wasm'
run-tcp-client-native-posix-go:
@./out/go/tcp_echo_client
run-tcp-client-native-posix-tinygo:
@./out/tinygo/tcp_echo_client
run-tcp-client-wasm-jssi-go: build-unisockets-runner
@docker run --net host -v ${PWD}:/src:z alphahorizonio/unisockets-runner sh -c 'cd /src && unisockets_runner --runBinary true --useGo true --useJSSI true --binaryPath ./out/go/tcp_echo_client.wasm'
run-tcp-client-wasm-wasi-tinygo: build-unisockets-runner
@docker run --net host -v ${PWD}:/src:z alphahorizonio/unisockets-runner sh -c 'cd /src && unisockets_runner --runBinary true --useTinyGo true --useWASI true --binaryPath ./out/tinygo/tcp_echo_client_wasi.wasm'
run-softmax-server-native-posix-go:
@./out/go/softmax_server
run-softmax-server-native-posix-tinygo:
@./out/tinygo/softmax_server
run-softmax-server-wasm-jssi-go: build-unisockets-runner
@docker run --net host -v ${PWD}:/src:z alphahorizonio/unisockets-runner sh -c 'cd /src && unisockets_runner --runBinary true --useGo true --useJSSI true --binaryPath ./out/go/softmax_server.wasm'
run-softmax-server-wasm-wasi-tinygo: build-unisockets-runner
@docker run --net host -v ${PWD}:/src:z alphahorizonio/unisockets-runner sh -c 'cd /src && unisockets_runner --runBinary true --useTinyGo true --useWASI true --binaryPath ./out/tinygo/softmax_server_wasi.wasm'
run-softmax-client-native-posix-go:
@./out/go/softmax_client
run-softmax-client-native-posix-tinygo:
@./out/tinygo/softmax_client
run-softmax-client-wasm-jssi-go: build-unisockets-runner
@docker run --net host -v ${PWD}:/src:z alphahorizonio/unisockets-runner sh -c 'cd /src && unisockets_runner --runBinary true --useGo true --useJSSI true --binaryPath ./out/go/softmax_echo_client.wasm'
run-softmax-client-wasm-wasi-tinygo: build-unisockets-runner
@docker run --net host -v ${PWD}:/src:z alphahorizonio/unisockets-runner sh -c 'cd /src && unisockets_runner --runBinary true --useTinyGo true --useWASI true --binaryPath ./out/tinygo/softmax_echo_client_wasi.wasm'
run-tinyperf-native-posix-go:
@./out/go/tinyperf $(ARGS)
run-tinyperf-wasm-jssi-go: build-unisockets-runner
@docker run --net host -v ${PWD}:/src:z alphahorizonio/unisockets-runner sh -c 'cd /src && unisockets_runner --runBinary true --useGo true --useJSSI true --binaryPath ./out/go/tinyperf.wasm' $(ARGS)