autogenpb/Makefile

88 lines
1.9 KiB
Makefile
Raw Permalink Normal View History

2024-11-29 08:30:19 -06:00
VERSION = $(shell git describe --tags)
BUILDTIME = $(shell date +%Y.%m.%d_%H%M)
2024-11-29 08:30:19 -06:00
simple: test
# make -C example clean simpleMutexGlobal goimports vet
# make -C example clean simpleMutexProtoc goimports vet
2025-01-11 03:42:14 -06:00
# make -C example deleteproto
2025-01-10 11:22:08 -06:00
2025-01-12 09:28:58 -06:00
full: clean auto goimports vet build test install
@echo everything worked and the example ran
2025-01-12 06:13:42 -06:00
# does a help example to debug the help logic
help: build
make -C example help
# if this passes, it should be OK to 'go install'
test:
reset
make goimports vet build
make -C example testGlobal
make -C example testProtoc
2025-01-12 05:32:58 -06:00
make -C example all
dryrun: build
make -C example dryrun
dryrun-clean: clean auto build
make -C example dryrun
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-13 08:10:17 -06:00
build:
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}"
# 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
bak:
mv -f autogenpb autogenpb.last
redo-protobuf:
rm -f *.pb.go
autogenpb --proto file.proto --package main
install: test
2024-11-29 08:30:19 -06:00
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:
# 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: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
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:
-rm -f auto.sort.pb.go
2024-11-29 08:30:19 -06:00
clean:
-rm -f go.*
2025-01-07 20:57:50 -06:00
-rm -f *.pb.go
-rm -f autogenpb
clean-more:
ls -l autogenpb autogenpb.last
-rm -f autogenpb.2*