forked from airbloc/airbloc-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
53 lines (40 loc) · 1.16 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
.PHONY: all airbloc generate-proto clean install uninstall run test test-all
DEST = $(shell pwd)/build/bin
PROTO_DIR := proto
PROTO_SRCS := $(shell find $(PROTO_DIR) -name *.proto)
RPC_PROTO_SRCS := $(shell find $(PROTO_DIR)/rpc -name *.proto)
all: airbloc bootnode
airbloc:
./env.sh go install ./cmd/airbloc
@echo "$(DEST)/airbloc"
bootnode:
./env.sh go install ./cmd/bootnode
@echo "$(DEST)/bootnode"
clean:
@rm -rf build/
install: airbloc
@cp -f $(DEST)/airbloc $GOPATH/bin/
generate-bind:
@go run contracts/generate_adapter.go
generate-proto:
@for PROTO in $(PROTO_SRCS); \
do protoc -I/usr/local/include -I. \
-I$$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \
--go_out=plugins=grpc:$$GOPATH/src \
--grpc-gateway_out=logtostderr=true:$$GOPATH/src \
$$PROTO; \
done
generate-python-pb:
@mkdir -p build/gen
@python -m grpc_tools.protoc -I. \
-I$$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \
--python_out=./build/gen \
--grpc_python_out=./build/gen \
$(RPC_PROTO_SRCS)
uninstall:
@rm -f $GOPATH/bin/airbloc
run: airbloc
@$(DEST)/airbloc
test: test-all
test-all:
@go test -v ./...