forked from shsms/ideacrawler
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
37 lines (27 loc) · 817 Bytes
/
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
GOPATHDIR=$(firstword $(subst :, ,${GOPATH}))
GOBIN=$(GOPATHDIR)/bin
default: build test
clean:
if [ -d build ]; then rm -rf build; fi
proto:
ifeq ($(GOPATHDIR),)
@echo "No gopath"
@exit 1
endif
protoc -I $(PWD)/ $(PWD)/protofiles/ideacrawler.proto --go_out=plugins=grpc:$(PWD)/
protopy:
python -m grpc_tools.protoc -I $(PWD)/protofiles --python_out=$(PWD)/protofiles --grpc_python_out=$(PWD)/protofiles $(PWD)/protofiles/ideacrawler.proto
build: clean
mkdir -p build
GO111MODULE=on go build -mod=vendor -o build/ideacrawler
buildall: clean proto build
install: build
cp build/ideacrawler $(GOBIN)/
test:
GO111MODULE=on go test -mod=vendor
vendor:
if [ -d vendor ]; then rm -rf vendor; fi
GO111MODULE=on go mod vendor -v
local: clean
mkdir -p build
GO111MODULE=on go build -o build/ideacrawler