-
-
Notifications
You must be signed in to change notification settings - Fork 51
/
Copy pathMakefile
47 lines (36 loc) · 1.2 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
CONFIGURATION ?= debug
SWIFT_BUILD_FLAGS ?=
NODEJS_FLAGS ?=
NODEJS = node --experimental-wasi-unstable-preview1 $(NODEJS_FLAGS)
FORCE:
TestSuites/.build/$(CONFIGURATION)/%.wasm: FORCE
swift build --package-path TestSuites \
--product $(basename $(notdir $@)) \
--configuration $(CONFIGURATION) \
-Xswiftc -Xclang-linker -Xswiftc -mexec-model=reactor \
-Xlinker --export-if-defined=main -Xlinker --export-if-defined=__main_argc_argv \
--static-swift-stdlib -Xswiftc -static-stdlib \
$(SWIFT_BUILD_FLAGS)
dist/%.wasm: TestSuites/.build/$(CONFIGURATION)/%.wasm
mkdir -p dist
cp $< $@
node_modules: package-lock.json
npm ci
.PHONY: build_rt
build_rt: node_modules
cd .. && npm run build
.PHONY: benchmark_setup
benchmark_setup: build_rt dist/BenchmarkTests.wasm
.PHONY: run_benchmark
run_benchmark:
$(NODEJS) bin/benchmark-tests.js
.PHONY: benchmark
benchmark: benchmark_setup run_benchmark
.PHONY: primary_test
primary_test: build_rt dist/PrimaryTests.wasm
$(NODEJS) bin/primary-tests.js
.PHONY: concurrency_test
concurrency_test: build_rt dist/ConcurrencyTests.wasm
$(NODEJS) bin/concurrency-tests.js
.PHONY: test
test: concurrency_test primary_test