78 lines
2.1 KiB
Makefile
78 lines
2.1 KiB
Makefile
VERSION = $(shell git describe --tags)
|
|
BUILDTIME = $(shell date +%Y.%m.%d_%H%M)
|
|
|
|
all: clean simpleMutexProtoc goimports build
|
|
./example
|
|
|
|
# if this passes, then autogenpb should be working
|
|
# and it is OK to 'go install' the binary
|
|
test: testGlobal testProtoc
|
|
|
|
testGlobal:
|
|
make clean
|
|
../autogenpb --proto fruit.proto --package main --mutex=false # first build with a global mutex
|
|
make build
|
|
|
|
testProtoc:
|
|
make clean
|
|
../autogenpb --proto fruit.proto --package main # inserts mutex into protoc .pb.go file
|
|
make build
|
|
|
|
help:
|
|
../autogenpb --package main --proto bad.proto
|
|
|
|
modproto: clean withMutex goimports vet build
|
|
./example
|
|
|
|
rawproto: clean withoutMutex goimports vet build
|
|
./example
|
|
|
|
deleteproto: clean
|
|
../autogenpb --proto fruit.proto --package main --delete
|
|
make build
|
|
|
|
vet:
|
|
@GO111MODULE=off go vet
|
|
|
|
rawbuild:
|
|
GO111MODULE=off go build -v
|
|
|
|
build: goimports vet
|
|
GO111MODULE=off go build -v
|
|
|
|
simpleMutexProtoc: clean
|
|
../autogenpb --proto fruit.proto --package main
|
|
|
|
# why does this fail to compile? I'm not sure. maybe someone smart can figure it out
|
|
# basically, it just trys to return the deleted record but says something
|
|
# about the RWmutex lock being copied and GO fails to compile
|
|
# I'm don't grok what is going on. This autogenerated code should
|
|
# provide as simple as one could hope for automated way to try to debug it though!
|
|
simpleMutexProtocWithDeleteCopy: clean
|
|
../autogenpb --proto fruit.proto --package main --delete
|
|
|
|
simpleMutexGlobal: clean
|
|
../autogenpb --proto fruit.proto --package main --mutex=false
|
|
|
|
withMutex: clean
|
|
../autogenpb --proto fruit.proto --package main
|
|
../autogenpb --proto file.proto --package main
|
|
../autogenpb --proto patchset.proto --package main
|
|
|
|
withoutMutex: clean
|
|
../autogenpb --proto fruit.proto --package main --mutex=false
|
|
../autogenpb --proto file.proto --package main --mutex=false
|
|
../autogenpb --proto patchset.proto --package main --mutex=false
|
|
|
|
dryrun:
|
|
../autogenpb --proto fruit.proto --package main --dry-run
|
|
# ../autogenpb --proto file.proto --package main
|
|
|
|
goimports:
|
|
goimports -w *.go
|
|
|
|
clean:
|
|
-rm -f go.*
|
|
-rm -f *.pb.go
|
|
-rm -f example
|