summaryrefslogtreecommitdiff
path: root/Makefile
blob: ada11ab06ea29e79d6e63f328e30354978c66a83 (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
45
46
47
48
49
50
51
52
53
54
55
# You must use the current google protoc-gen-go
#
# cd ~/go/src/google.golang.org/protobuf/cmd/protoc-gen-go
# go install

all: generate goimports vet

generate: clean
	go mod init
	go mod tidy
	go generate

go-generate:
	rm -f *.pb.go *.patch

vet:
	@GO111MODULE=off go vet
	@echo this go library package builds okay

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

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

clean:
	rm -f *.pb.go
	-rm -f go.*

proto:droplet.pb.go hypervisor.pb.go event.pb.go cluster.pb.go

droplet.pb.go: droplet.proto
	autogenpb --proto droplet.proto

hypervisor.pb.go: hypervisor.proto
	autogenpb --proto hypervisor.proto

event.pb.go: event.proto
	autogenpb --proto event.proto

cluster.pb.go: cluster.proto
	autogenpb --proto cluster.proto

deps:
	apt install golang-goprotobuf-dev
	apt install protobuf-compiler

push:
	git pull
	git add --all
	git commit -a -s
	git push