forked from stellar/rs-stellar-xdr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
82 lines (70 loc) · 3.03 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
XDR_BASE_URL_CURR=https://github.com/stellar/stellar-core/raw/master/src/protocol-curr/xdr
XDR_BASE_LOCAL_CURR=xdr/curr
XDR_FILES_CURR= \
Stellar-SCP.x \
Stellar-ledger-entries.x \
Stellar-ledger.x \
Stellar-overlay.x \
Stellar-transaction.x \
Stellar-types.x
XDR_FILES_LOCAL_CURR=$(addprefix xdr/curr/,$(XDR_FILES_CURR))
XDR_BASE_URL_NEXT=https://github.com/stellar/stellar-core/raw/master/src/protocol-next/xdr
XDR_BASE_LOCAL_NEXT=xdr/next
XDR_FILES_NEXT= \
Stellar-SCP.x \
Stellar-ledger-entries.x \
Stellar-ledger.x \
Stellar-overlay.x \
Stellar-transaction.x \
Stellar-types.x \
Stellar-contract.x
XDR_FILES_LOCAL_NEXT=$(addprefix xdr/next/,$(XDR_FILES_NEXT))
export RUSTFLAGS=-Dwarnings -Dclippy::all -Dclippy::pedantic
all: build test
test:
cargo test --no-default-features --features 'std'
cargo test --no-default-features --features 'alloc'
cargo test --no-default-features --features ''
cargo test --no-default-features --features 'next,std'
cargo test --no-default-features --features 'next,alloc'
cargo test --no-default-features --features 'next'
build: src/curr.rs src/next.rs
cargo clippy --all-targets --no-default-features --features 'std'
cargo clippy --all-targets --no-default-features --features 'alloc'
cargo clippy --all-targets --no-default-features --features ''
cargo clippy --all-targets --no-default-features --features 'std' --release --target wasm32-unknown-unknown
cargo clippy --all-targets --no-default-features --features 'alloc' --release --target wasm32-unknown-unknown
cargo clippy --all-targets --no-default-features --features '' --release --target wasm32-unknown-unknown
cargo clippy --all-targets --no-default-features --features 'next,std'
cargo clippy --all-targets --no-default-features --features 'next,alloc'
cargo clippy --all-targets --no-default-features --features 'next'
cargo clippy --all-targets --no-default-features --features 'next,std' --release --target wasm32-unknown-unknown
cargo clippy --all-targets --no-default-features --features 'next,alloc' --release --target wasm32-unknown-unknown
cargo clippy --all-targets --no-default-features --features 'next' --release --target wasm32-unknown-unknown
watch:
cargo watch --clear --watch-when-idle --shell '$(MAKE)'
src/curr.rs: $(XDR_FILES_LOCAL_CURR)
touch $@
docker run -it --rm -v $$PWD:/wd -w /wd ruby /bin/bash -c '\
gem install specific_install -v 0.3.7 && \
gem specific_install https://github.com/stellar/xdrgen.git -b master && \
xdrgen --language rust --namespace curr --output src/ $^ \
'
rustfmt $@
src/next.rs: $(XDR_FILES_LOCAL_NEXT)
touch $@
docker run -it --rm -v $$PWD:/wd -w /wd ruby /bin/bash -c '\
gem install specific_install -v 0.3.7 && \
gem specific_install https://github.com/stellar/xdrgen.git -b master && \
xdrgen --language rust --namespace next --output src/ $^ \
'
rustfmt $@
$(XDR_FILES_LOCAL_CURR):
curl -L -o $@ $(XDR_BASE_URL_CURR)/$(notdir $@)
$(XDR_FILES_LOCAL_NEXT):
curl -L -o $@ $(XDR_BASE_URL_NEXT)/$(notdir $@)
clean:
rm -f xdr/*/*.x
rm -f src/curr.rs
rm -f src/next.rs
cargo clean