correct build rules. attempt ldflags VERSION

This commit is contained in:
Jeff Carr 2024-12-05 19:15:34 -06:00
parent 439c6e3b01
commit 85f3a08238
2 changed files with 14 additions and 9 deletions

View File

@ -1,24 +1,25 @@
VERSION = $(shell git describe --tags) VERSION = $(shell git describe --tags)
BUILDTIME = $(shell date +%Y.%m.%d)
all: plugin all: gocui.so
ldd ../gocui.so @#ldd gocui.so
plugin: gocui.so:
GO111MODULE=off go build -v -work -buildmode=plugin -o gocui.so GO111MODULE=off go build -v -work -buildmode=plugin -o gocui.so \
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
install: install:
rm -f gocui.so rm -f gocui.so
go build -buildmode=plugin -o ~/go/lib/gocui-${VERSION}.so go build -buildmode=plugin -o ~/go/lib/gocui-${VERSION}.so \
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
# for testing custom golang # for testing custom golang
custom: custom:
# GO111MODULE=off go build -v # GO111MODULE=off go build -v
GO111MODULE=off go build -v -work -buildmode=blah GO111MODULE=off go build -v -work -buildmode=blah
official: clean:
mkdir -p ~/go/lib/go.wit.com/toolkits/gocui/ rm -f gocui gocui.so
go build -v -x -buildmode=plugin -o ~/go/lib/go.wit.com/toolkits/gocui/gocui-${VERSION}.so
# Test the README.md & doc.go file # Test the README.md & doc.go file
# this runs pkgsite, the binary that does dev.go.dev # this runs pkgsite, the binary that does dev.go.dev
# go install golang.org/x/pkgsite/cmd/pkgsite@latest # go install golang.org/x/pkgsite/cmd/pkgsite@latest

View File

@ -17,6 +17,10 @@ import (
"go.wit.com/toolkits/tree" "go.wit.com/toolkits/tree"
) )
// sent via -ldflags
var VERSION string
var BUILDTIME string
func queueToolkitClose() { func queueToolkitClose() {
me.baseGui.Close() me.baseGui.Close()
} }