-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
52 lines (42 loc) · 1.51 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
PREFIX ?= /usr/local
BIN ?= $(PREFIX)/bin
UNAME_S ?= $(shell uname -s)
UNAME_M ?= $(shell uname -m)
BUF_VERSION ?= 0.11.0
PROTOC_VERSION ?= 3.11.2
ifeq ($(UNAME_S),Linux)
PROTOC_ZIP ?= protoc-3.11.2-linux-x86_64.zip
endif
ifeq ($(UNAME_S),Darwin)
PROTOC_ZIP ?= protoc-3.11.2-osx-x86_64.zip
endif
proto-tools: proto-tools-stamp
proto-tools-stamp:
@echo "Installing protoc compiler..."
@(cd /tmp; \
curl -OL "https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/${PROTOC_ZIP}"; \
unzip -o ${PROTOC_ZIP} -d $(PREFIX) bin/protoc; \
unzip -o ${PROTOC_ZIP} -d $(PREFIX) 'include/*'; \
rm -f ${PROTOC_ZIP})
@echo "Installing protoc-gen-buf-check-breaking..."
@curl -sSL \
"https://github.com/bufbuild/buf/releases/download/v${BUF_VERSION}/protoc-gen-buf-check-breaking-${UNAME_S}-${UNAME_M}" \
-o "${BIN}/protoc-gen-buf-check-breaking" && \
chmod +x "${BIN}/protoc-gen-buf-check-breaking"
@echo "Installing buf..."
@curl -sSL \
"https://github.com/bufbuild/buf/releases/download/v${BUF_VERSION}/buf-${UNAME_S}-${UNAME_M}" \
-o "${BIN}/buf" && \
chmod +x "${BIN}/buf"
touch $@
protoc-gen-gocosmos:
@echo "Installing protoc-gen-gocosmos..."
@go install github.com/regen-network/cosmos-proto/protoc-gen-gocosmos
proto-gen:
@./scripts/protocgen.sh
install: go.sum
go install ./cmd/astrod
go install ./cmd/astrocli
build-linux-amd64: go.sum
env GOOS=linux GOARCH=amd64 go build -o ./build/astrod ./cmd/astrod
env GOOS=linux GOARCH=amd64 go build -o ./build/astrocli ./cmd/astrocli