summaryrefslogtreecommitdiff
path: root/Makefile
blob: 1f704e363520f94bcc56012c3fc195ee66ffe58f (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
all: filetype.pb.go goimports vet
	@echo This GO code passes the compile checks

# fixes your numbers if you move things around
# THIS TOTALLY BREAKS THE POINT OF PROTOBUF
# To work around that breaking, you must change the version
# also, all the wrapping code must support this. which it doesn't
proto-renumber: clean
	autogenpb --renumber --proto filetype.proto
	make goimports vet

filetype.pb.go: filetype.proto
	make generate

generate: clean
	go mod init
	go mod tidy
	go generate

raw-protoc:
	cd ~/go/src && protoc --go_out=. --proto_path=go.wit.com/lib/protobuf/filepb --go_opt=Mfakefile.proto=go.wit.com/lib/protobuf/filepb fakefile.proto

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

goimports:
	goimports -w *.go

vet:
	@GO111MODULE=off go vet

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