From 0a38ebfd4780d5010952e5e34bbf9edd79e317ef Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sat, 16 Nov 2024 00:08:04 -0600 Subject: [PATCH] fix build --- Makefile | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index ac78871..81f97b6 100644 --- a/Makefile +++ b/Makefile @@ -1,21 +1,34 @@ VERSION = $(shell git describe --tags) +BUILDTIME = $(shell date +%Y.%m.%d) -all: - -rm resources/*.so - touch resources/blank.so - -cp -a ~/go/src/go.wit.com/toolkits/*.so resources/ # embed the toolkit plugins in the binary - GO111MODULE=off go build -v -x \ - -ldflags "-X main.VERSION=${VERSION}" +all: build ./helloworld +build: + GO111MODULE=off go build \ + -ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}" + +verbose: + GO111MODULE=off go build -v -x \ + -ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}" + install: - GO111MODULE=off go install -v -x \ - -ldflags "-X main.VERSION=${VERSION}" - ./helloworld + GO111MODULE=off go install \ + -ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}" + +clean: + -rm -f gadgetwindow + -rm resources/*.so + touch resources/blank.so + +# embed the toolkit plugins in the binary +embed: + -rm resources/*.so + touch resources/blank.so + -cp -a ~/go/src/go.wit.com/toolkits/*.so resources/ gocui: - GO111MODULE=off go build -v -x - ./helloworld --gui gocui >/tmp/helloworld.stdout 2>&1 + ./helloworld --gui gocui goimports: goimports -w *.go @@ -25,4 +38,3 @@ redomod: goimports -w *.go GO111MODULE= go mod init GO111MODULE= go mod tidy -