summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-09 01:03:23 -0500
committerJeff Carr <[email protected]>2025-10-09 01:03:23 -0500
commitd10f79f31ce22bd5564b752ddf3eae68c4456cf6 (patch)
tree6296d39f1984e94c18ad0ede0b8ecae36acce452
parent174bed4183002f0490bed8fe3efc7b99430d2b5c (diff)
common protobuf makefilev0.0.43
-rw-r--r--Makefile64
-rw-r--r--Makefile.gus68
2 files changed, 82 insertions, 50 deletions
diff --git a/Makefile b/Makefile
index 0834153..16b464b 100644
--- a/Makefile
+++ b/Makefile
@@ -1,11 +1,8 @@
-.PHONY: build
+all: portmap.pb.go goimports vet
+ @echo This GO code passes the compile checks
-VERSION = $(shell git describe --tags)
-BUILDTIME = $(shell date +%Y.%m.%d_%H%M)
-
-all: generate vet install
- @#./gus --config /etc/gus/gus.text
- gus --me
+portmap.pb.go: portmap.proto
+ make generate
generate: clean
go mod init
@@ -15,54 +12,21 @@ generate: clean
go-generate:
rm -f *.pb.go *.patch
-vet:
-
-gocui: build
- ./gus --gui gocui --config /etc/gus/gus.text >/tmp/gocui.log 2>&1
-
-build: goimports vet
- GO111MODULE=off go build -v -x \
- -ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
-
-install: goimports vet
- GO111MODULE=off go install \
- -ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
-
-install-verbose: goimports vet
- GO111MODULE=off go install -v -x \
- -ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
-
-sudo: build
- sudo ./gus
-
-# makes a .deb package
-debian:
- go-deb --repo go.wit.com/lib/daemons/gus
-
-daemon:
- ./gus --daemon --no-gui --config /etc/gus/gus.text
-
goimports:
goimports -w *.go
vet:
@GO111MODULE=off go vet
- @echo this go binary package builds okay
clean:
- rm -f go.* *.pb.go
- rm -f gus
-
-proto: portmap.pb.go event.pb.go
-
-portmap.pb.go: portmap.proto
- autogenpb --proto portmap.proto
-
-event.pb.go: event.proto
- autogenpb --proto event.proto
-
-list:
- curl "http://localhost:2522/list"
+ rm -f *.pb.go *.patch
+ -rm -f go.*
+ go-mod-clean purge
-save:
- curl "http://localhost:2522/save"
+# 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 portmap.proto
+ make goimports vet
diff --git a/Makefile.gus b/Makefile.gus
new file mode 100644
index 0000000..0834153
--- /dev/null
+++ b/Makefile.gus
@@ -0,0 +1,68 @@
+.PHONY: build
+
+VERSION = $(shell git describe --tags)
+BUILDTIME = $(shell date +%Y.%m.%d_%H%M)
+
+all: generate vet install
+ @#./gus --config /etc/gus/gus.text
+ gus --me
+
+generate: clean
+ go mod init
+ go mod tidy
+ go generate
+
+go-generate:
+ rm -f *.pb.go *.patch
+
+vet:
+
+gocui: build
+ ./gus --gui gocui --config /etc/gus/gus.text >/tmp/gocui.log 2>&1
+
+build: goimports vet
+ GO111MODULE=off go build -v -x \
+ -ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
+
+install: goimports vet
+ GO111MODULE=off go install \
+ -ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
+
+install-verbose: goimports vet
+ GO111MODULE=off go install -v -x \
+ -ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
+
+sudo: build
+ sudo ./gus
+
+# makes a .deb package
+debian:
+ go-deb --repo go.wit.com/lib/daemons/gus
+
+daemon:
+ ./gus --daemon --no-gui --config /etc/gus/gus.text
+
+goimports:
+ goimports -w *.go
+
+vet:
+ @GO111MODULE=off go vet
+ @echo this go binary package builds okay
+
+clean:
+ rm -f go.* *.pb.go
+ rm -f gus
+
+proto: portmap.pb.go event.pb.go
+
+portmap.pb.go: portmap.proto
+ autogenpb --proto portmap.proto
+
+event.pb.go: event.proto
+ autogenpb --proto event.proto
+
+list:
+ curl "http://localhost:2522/list"
+
+save:
+ curl "http://localhost:2522/save"