forked from aurora-is-near/evm2near
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
68 lines (52 loc) · 2.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
CARGO = cargo
LIPO = lipo
WASM_STRIP = wasm-strip
all: evm2near
release: \
evm2near-macos-arm \
evm2near-macos-x86 \
evm2near-windows-arm.exe \
evm2near-windows-x86.exe \
evm2near-linux-arm \
evm2near-linux-x86
EVM2NEAR_FILES = $(wildcard bin/evm2near/src/*.rs)
EVMLIB_FILES = $(shell find lib/evmlib/src -name "*.rs")
RELOOPER_FILES = $(shell find lib/relooper/src -name "*.rs")
evm2near: bin/evm2near/Cargo.toml $(EVM2NEAR_FILES) $(RELOOPER_FILES) Makefile evmlib.wasi evmlib.wasm
echo $^
$(CARGO) build --package=evm2near
ln -sf target/debug/evm2near evm2near
evm2near-macos: evm2near-macos-arm evm2near-macos-x86
$(LIPO) -create -output $@ $^
evm2near-macos-arm: bin/evm2near/Cargo.toml $(EVM2NEAR_FILES) Makefile evmlib.wasi evmlib.wasm
$(CARGO) build --package=evm2near --release --target=aarch64-apple-darwin
ln -sf target/aarch64-apple-darwin/release/evm2near $@
evm2near-macos-x86: bin/evm2near/Cargo.toml $(EVM2NEAR_FILES) Makefile evmlib.wasi evmlib.wasm
$(CARGO) build --package=evm2near --release --target=x86_64-apple-darwin
ln -sf target/x86_64-apple-darwin/release/evm2near $@
evm2near-windows-arm.exe: bin/evm2near/Cargo.toml $(EVM2NEAR_FILES) Makefile evmlib.wasi evmlib.wasm
#$(CARGO) build --package=evm2near --release --target=aarch64-pc-windows-msvc
#ln -sf target/aarch64-pc-windows-msvc/release/evm2near.exe $@
evm2near-windows-x86.exe: bin/evm2near/Cargo.toml $(EVM2NEAR_FILES) Makefile evmlib.wasi evmlib.wasm
$(CARGO) build --package=evm2near --release --target=x86_64-pc-windows-gnu
ln -sf target/x86_64-pc-windows-gnu/release/evm2near.exe $@
evm2near-linux-arm: bin/evm2near/Cargo.toml $(EVM2NEAR_FILES) Makefile evmlib.wasi evmlib.wasm
$(CARGO) build --package=evm2near --release --target=aarch64-unknown-linux-musl
ln -sf target/aarch64-unknown-linux-musl/release/evm2near $@
evm2near-linux-x86: bin/evm2near/Cargo.toml $(EVM2NEAR_FILES) Makefile evmlib.wasi evmlib.wasm
$(CARGO) build --package=evm2near --release --target=x86_64-unknown-linux-musl
ln -sf target/x86_64-unknown-linux-musl/release/evm2near $@
evmlib.wasm: lib/evmlib/Cargo.toml $(EVMLIB_FILES) Makefile
$(CARGO) build --package=evmlib --release --target=wasm32-unknown-unknown --no-default-features --features=gas,pc,near
$(WASM_STRIP) target/wasm32-unknown-unknown/release/$@
ln -sf target/wasm32-unknown-unknown/release/$@ $@
evmlib.wasi: lib/evmlib/Cargo.toml $(EVMLIB_FILES) Makefile
$(CARGO) build --package=evmlib --release --target=wasm32-wasi --no-default-features --features=gas,pc
$(WASM_STRIP) target/wasm32-wasi/release/evmlib.wasm
ln -sf target/wasm32-wasi/release/evmlib.wasm $@
check:
$(CARGO) test --workspace -- --nocapture --test-threads=1 --color=always
clean:
$(CARGO) clean
rm -f evm2near evm2near-macos evm2near-*-* evmlib.wasi evmlib.wasm
.PHONY: check clean