-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
43 lines (34 loc) · 1.17 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
.PHONY: compile assets
PROTOC_GEN_GO := $(GOPATH)/bin/protoc-gen-go
GO_BINDATA := $(GOPATH)/bin/go-bindata
PROTOC := $(shell which protoc)
# If protoc isn't on the path, set it to a target that's never up to date, so
# the install command always runs.
ifeq ($(PROTOC),)
PROTOC = must-rebuild
endif
# Figure out which machine we're running on.
UNAME := $(shell uname)
$(PROTOC):
# Run the right installation command for the operating system.
ifeq ($(UNAME), Darwin)
brew install protobuf
endif
ifeq ($(UNAME), Linux)
sudo apt-get install protobuf-compiler
endif
# You can add instructions for other operating systems here, or use different
# branching logic as appropriate.
# If $GOPATH/bin/protoc-gen-go does not exist, we'll run this command to install
# it.
$(PROTOC_GEN_GO):
go get -u github.com/golang/protobuf/protoc-gen-go
yaticker.pb.go: proto/yaticker.proto | $(PROTOC_GEN_GO) $(PROTOC)
protoc --go_out=. proto/yaticker.proto
# This is a "phony" target - an alias for the above command, so "make compile"
# still works.
compile: yaticker.pb.go
$(GOPATH)/bin/proto-make-example: $(shell find . -name '*.go')
go install .
$(GO_BINDATA):
go get github.com/kevinburke/go-bindata