2024-11-29 08:30:19 -06:00
|
|
|
VERSION = $(shell git describe --tags)
|
2025-01-08 19:45:48 -06:00
|
|
|
BUILDTIME = $(shell date +%Y.%m.%d_%H%M)
|
2024-11-29 08:30:19 -06:00
|
|
|
|
2025-01-10 11:22:08 -06:00
|
|
|
simple: build
|
2025-01-10 19:37:32 -06:00
|
|
|
# make -C example clean simpleMutexGlobal goimports vet
|
2025-01-11 03:13:20 -06:00
|
|
|
make -C example clean simpleMutexProtoc goimports vet
|
2025-01-10 11:22:08 -06:00
|
|
|
|
|
|
|
full: install clean auto goimports vet build test install
|
2025-01-09 20:40:00 -06:00
|
|
|
@echo everything worked and the example ran
|
2025-01-08 19:45:48 -06:00
|
|
|
|
2025-01-09 20:40:00 -06:00
|
|
|
test: goimports build test
|
2024-11-29 11:15:40 -06:00
|
|
|
|
2024-11-29 08:30:19 -06:00
|
|
|
vet:
|
|
|
|
@GO111MODULE=off go vet
|
2024-12-01 22:21:09 -06:00
|
|
|
@echo this go binary package should build okay
|
2024-11-29 08:30:19 -06:00
|
|
|
|
2025-01-09 20:23:52 -06:00
|
|
|
# autogen uses autogen to build. keep a working copy somewhere
|
|
|
|
recover:
|
|
|
|
make clean
|
|
|
|
./autogenpb.last --proto file.proto --package main
|
|
|
|
make goimports
|
|
|
|
make build
|
2025-01-08 19:45:48 -06:00
|
|
|
|
2025-01-10 11:22:08 -06:00
|
|
|
build: goimports
|
2024-11-29 08:30:19 -06:00
|
|
|
GO111MODULE=off go build \
|
|
|
|
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
|
2025-01-10 07:40:24 -06:00
|
|
|
# autogen uses autogen to build. keep a working copy somewhere
|
2025-01-09 20:23:52 -06:00
|
|
|
cp -f autogenpb autogenpb.${BUILDTIME}
|
2024-11-29 08:30:19 -06:00
|
|
|
|
2025-01-08 19:45:48 -06:00
|
|
|
bak:
|
|
|
|
mv -f autogenpb autogenpb.last
|
|
|
|
|
2024-11-29 08:30:19 -06:00
|
|
|
install:
|
|
|
|
GO111MODULE=off go install \
|
|
|
|
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
|
|
|
|
|
2025-01-08 20:52:47 -06:00
|
|
|
auto:
|
2025-01-09 20:40:00 -06:00
|
|
|
# rm -f auto.pb.go
|
|
|
|
autogenpb --proto file.proto --package main
|
|
|
|
# rm -f auto.sort.pb.go auto.newsort.pb.go # auto.marshal.pb.go
|
2025-01-08 19:45:48 -06:00
|
|
|
|
2025-01-08 19:56:45 -06:00
|
|
|
test:
|
2025-01-10 23:55:12 -06:00
|
|
|
make -C example rawproto
|
2025-01-11 01:30:08 -06:00
|
|
|
# The Go Protocol Buffers library embeds a sync.Mutex within the MessageState struct to prevent unintended shallow copies of message structs
|
|
|
|
# It only fails in Marshal() functions though. That is dumb.
|
|
|
|
make -C example modproto # THIS DOES NOT WORK. It could work however. This autogenerated code could be used to debug it.
|
2025-01-08 19:56:45 -06:00
|
|
|
|
|
|
|
junk:
|
2025-01-09 12:55:03 -06:00
|
|
|
cd example; rm -f go.* *.pb.go
|
2025-01-09 15:03:05 -06:00
|
|
|
cd example; ../autogenpb --proto file.proto --package yellow
|
2025-01-09 12:55:03 -06:00
|
|
|
cd example; GO111MODULE=off go vet
|
2025-01-08 19:45:48 -06:00
|
|
|
|
2024-11-29 08:30:19 -06:00
|
|
|
goimports:
|
|
|
|
goimports -w *.go
|
|
|
|
|
|
|
|
redomod:
|
|
|
|
rm -f go.*
|
|
|
|
GO111MODULE= go mod init
|
|
|
|
GO111MODULE= go mod tidy
|
2024-11-29 21:49:11 -06:00
|
|
|
go mod edit -go=1.20
|
2024-11-29 08:30:19 -06:00
|
|
|
|
|
|
|
reset:
|
2025-01-08 19:45:48 -06:00
|
|
|
-rm -f auto.sort.pb.go
|
2024-11-29 08:30:19 -06:00
|
|
|
|
|
|
|
clean:
|
2024-11-30 12:17:38 -06:00
|
|
|
-rm -f go.*
|
2025-01-07 20:57:50 -06:00
|
|
|
-rm -f *.pb.go
|
2024-11-29 10:20:06 -06:00
|
|
|
-rm -f autogenpb
|