-
-
Notifications
You must be signed in to change notification settings - Fork 48
/
Makefile
48 lines (39 loc) · 1.68 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
MAKEFILE_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
ifeq ($(SWIFT_SDK_ID),)
SWIFT_BUILD_FLAGS := --triple wasm32-unknown-wasi
else
SWIFT_BUILD_FLAGS := --swift-sdk $(SWIFT_SDK_ID)
endif
.PHONY: bootstrap
bootstrap:
npm ci
.PHONY: build
build:
swift build --triple wasm32-unknown-wasi
npm run build
.PHONY: test
test:
@echo Running integration tests
cd IntegrationTests && \
CONFIGURATION=debug SWIFT_BUILD_FLAGS="$(SWIFT_BUILD_FLAGS)" $(MAKE) test && \
CONFIGURATION=debug SWIFT_BUILD_FLAGS="$(SWIFT_BUILD_FLAGS) -Xswiftc -DJAVASCRIPTKIT_WITHOUT_WEAKREFS" $(MAKE) test && \
CONFIGURATION=release SWIFT_BUILD_FLAGS="$(SWIFT_BUILD_FLAGS)" $(MAKE) test && \
CONFIGURATION=release SWIFT_BUILD_FLAGS="$(SWIFT_BUILD_FLAGS) -Xswiftc -DJAVASCRIPTKIT_WITHOUT_WEAKREFS" $(MAKE) test
.PHONY: unittest
unittest:
@echo Running unit tests
swift build --build-tests -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)
node --experimental-wasi-unstable-preview1 scripts/test-harness.mjs ./.build/debug/JavaScriptKitPackageTests.wasm
.PHONY: benchmark_setup
benchmark_setup:
SWIFT_BUILD_FLAGS="$(SWIFT_BUILD_FLAGS)" CONFIGURATION=release $(MAKE) -C IntegrationTests benchmark_setup
.PHONY: run_benchmark
run_benchmark:
SWIFT_BUILD_FLAGS="$(SWIFT_BUILD_FLAGS)" CONFIGURATION=release $(MAKE) -s -C IntegrationTests run_benchmark
.PHONY: perf-tester
perf-tester:
cd ci/perf-tester && npm ci
.PHONY: regenerate_swiftpm_resources
regenerate_swiftpm_resources:
npm run build
cp Runtime/lib/index.js Runtime/lib/index.mjs Sources/JavaScriptKit/Runtime