summaryrefslogtreecommitdiff
path: root/Makefile
blob: db4d2a7646a098ccc083acf2fd793bb6ec136f34 (plain)
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
# You must use the current protoc-gen-go
#
# go-clone --go-src google.golang.org/protobuf
# cd ~/go/src/google.golang.org/protobuf/cmd/protoc-gen-go
# go install


all: package.pb.go machine.pb.go
	make -C example

vet: lint
	GO111MODULE=off go vet

lint:
	-buf lint git.proto

# autofixes your import headers in your golang files
goimports:
	goimports -w *.go
	make -C example goimports

redomod:
	rm -f go.*
	GO111MODULE= go mod init
	GO111MODULE= go mod tidy

clean:
	rm -f *.pb.go
	-rm -f go.*
	make -C example clean

package.pb.go: package.proto
	# protoc --go_out=. droplet.proto
	# This is switched over to use the new protoc-gen-go from   google.golang.org/protobuf/cmd/protoc-gen-go
	# the debian one (2024/10/21) seems to be the older/original one from github.com/golang/protobuf/protoc-gen-go
	cd ~/go/src && protoc --go_out=. --proto_path=go.wit.com/lib/protobuf/zoopb \
		--go_opt=Mpackage.proto=go.wit.com/lib/protobuf/zoopb \
		package.proto

machine.pb.go: machine.proto
	cd ~/go/src && protoc --go_out=. --proto_path=go.wit.com/lib/protobuf/zoopb \
		--go_opt=Mpackage.proto=go.wit.com/lib/protobuf/zoopb \
		--go_opt=Mmachine.proto=go.wit.com/lib/protobuf/zoopb \
		machine.proto