-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
68 lines (49 loc) · 1.89 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
VERSION = 0.5.0
# GOLINT:=$(shell go list -f {{.Target}} golang.org/x/lint/golint)
UNAME_S = $(shell uname -s)
ENCLAVE_NAME=enclave.signed.so
all: build
build: build-rust build/signer
build-rust:
cd tee_validator && make && make client
cp tee_validator/bin/$(ENCLAVE_NAME) .
build/signer: cmd/signer/main.go $(wildcard internal/**/*.go tee_validator/**/*.go)
CGO_ENABLED=1 go build -o ./build/signer ${gobuild_flags} ./cmd/signer
cp $(ENCLAVE_NAME) ./build/
vendor:
cargo vendor tee_validator/third_party/vendor --manifest-path tee_validator/third_party/build/Cargo.toml
deb: build
ifneq ($(UNAME_S),Linux)
exit 1
endif
rm -rf /tmp/TendermintValidator
mkdir -p /tmp/TendermintValidator/deb/bin
mkdir -p /tmp/TendermintValidator/deb/usr/local/lib
mv -f ./build/signer /tmp/TendermintValidator/deb/bin/signer
mv -f ./build/enclave.signed.so /tmp/TendermintValidator/deb/usr/local/lib/enclave.signed.so
chmod +x /tmp/TendermintValidator/deb/bin/signer
mkdir -p /tmp/TendermintValidator/deb/DEBIAN/
mkdir -p /tmp/TendermintValidator/deb/opt/tendermint-validator/
cp -r ./packaging_ubuntu/opt/* /tmp/TendermintValidator/deb/opt/
cp ./packaging_ubuntu/control /tmp/TendermintValidator/deb/DEBIAN/control
echo "" >> /tmp/TendermintValidator/deb/DEBIAN/control
cp ./packaging_ubuntu/postinst /tmp/TendermintValidator/deb/DEBIAN/postinst
chmod 755 /tmp/TendermintValidator/deb/DEBIAN/postinst
cp ./packaging_ubuntu/postrm /tmp/TendermintValidator/deb/DEBIAN/postrm
chmod 755 /tmp/TendermintValidator/deb/DEBIAN/postrm
dpkg-deb --build /tmp/TendermintValidator/deb/ .
-rm -rf /tmp/TendermintValidator
#lint: tools
# @$(GOLINT) -set_exit_status ./...
test:
@go test -short ./...
race:
@go test -race -short ./...
msan:
@go test -msan -short ./...
#tools:
# @go install golang.org/x/lint/golint
clean:
rm -rf build
cd tee_validator && make clean
.PHONY: all lint test race msan tools clean build