From 9c6a232bb6c9746678e58d69b2592a52fd118835 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sat, 16 Nov 2024 00:06:21 -0600 Subject: fix build --- Makefile | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index ec8440a..b01391a 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,28 @@ .PHONY: debian -run: build - reset - cp -f control-panel-dns ~/ - sudo ./control-panel-dns +VERSION = $(shell git describe --tags) +BUILDTIME = $(shell date +%Y.%m.%d) + +all: build + ./control-panel-dns build: - -mkdir -p resources/ - -cp ~/go/src/go.wit.com/toolkits/*.so resources/ - GO111MODULE="off" go build -v + 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 \ + -ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}" + +# 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/ goimports: goimports -w *.go @@ -41,9 +55,6 @@ nocui: reset build check-git-clean: @git diff-index --quiet HEAD -- || (echo "Git repository is dirty, please commit your changes first"; exit 1) -install: - go install -v go.wit.com/control-panel-dns@latest - build-release: reset go get -v -u -x . @@ -71,10 +82,6 @@ clean: -rm -f resources/*.so -rm *.deb -debian: - cd debian && make - -wit mirrors - netlink: GO111MODULE="off" go get -v -u github.com/vishvananda/netlink -- cgit v1.2.3