summaryrefslogtreecommitdiff
path: root/Makefile
blob: 3485f901c1d50e9e37f9abd2b620fef6e4bae976 (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
# 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: forgeConfig.pb.go patch.pb.go set.pb.go goimports vet

generate: clean
	go mod init
	go mod tidy
	go generate

go-generate:
	rm -f *.pb.go *.patch
	go get go.wit.com/apps/autogenpb

forgeConfig.pb.go: forgeConfig.proto
	autogenpb --proto forgeConfig.proto

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

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

clean:
	rm -f *.pb.go *.patch
	-rm -f go.*
	go-mod-clean purge

# patchset.pb.go: patchset.proto
# 	autogenpb --proto patchset.proto

patch.pb.go: patch.proto
	autogenpb --proto patch.proto

set.pb.go: set.proto
	autogenpb --proto set.proto

protoc-test:
	cd ~/go/src && protoc \
	    --proto_path=. \
	    --go_out=. \
	    --go_opt=Mgo.wit.com/lib/protobuf/forgepb/patchset.proto=go.wit.com/lib/protobuf/forgepb \
	    --go_opt=Mgo.wit.com/lib/protobuf/httppb/httpRequest.proto=go.wit.com/lib/protobuf/httppb \
	    go.wit.com/lib/protobuf/forgepb/patchset.proto