diff options
| author | Jeff Carr <[email protected]> | 2024-11-16 00:06:21 -0600 | 
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-11-16 00:06:21 -0600 | 
| commit | 9c6a232bb6c9746678e58d69b2592a52fd118835 (patch) | |
| tree | fe94f7343a29bb7207b2e8e97e4c34746dca6b6c | |
| parent | 1082f0b7f904cf5fc452fd93ada5907474f3f149 (diff) | |
fix buildHEADv0.22.9v0.22.8v0.22.7v0.22.6v0.22.59v0.22.58v0.22.57v0.22.56v0.22.55v0.22.54v0.22.53v0.22.52v0.22.51v0.22.50v0.22.5v0.22.49v0.22.48v0.22.47v0.22.46v0.22.45v0.22.44v0.22.43v0.22.42v0.22.41v0.22.40v0.22.4v0.22.39v0.22.38v0.22.37v0.22.36v0.22.35v0.22.34v0.22.33v0.22.32v0.22.31v0.22.30v0.22.3v0.22.29v0.22.28v0.22.27v0.22.26v0.22.25v0.22.24v0.22.23v0.22.22v0.22.21v0.22.20v0.22.19v0.22.18v0.22.17v0.22.16v0.22.15v0.22.14v0.22.13v0.22.12v0.22.11v0.22.10maindevel
| -rw-r--r-- | Makefile | 35 | ||||
| -rw-r--r-- | argv.go | 10 | ||||
| -rw-r--r-- | main.go | 4 | 
3 files changed, 33 insertions, 16 deletions
@@ -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 @@ -10,12 +10,14 @@ import (  	"go.wit.com/log"  ) -var args struct { +var argv args + +type args struct {  	Daemon bool `arg:"--daemon" help:"run without a gui"`  }  func init() { -	arg.MustParse(&args) +	arg.MustParse(&argv)  	if debugger.ArgDebug() {  		log.Info("cmd line --debugger == true") @@ -25,3 +27,7 @@ func init() {  		}()  	}  } + +func (args) Version() string { +	return "go-clone " + VERSION + "    Built on " + BUILDTIME +} @@ -17,6 +17,10 @@ import (  	"go.wit.com/lib/gui/linuxstatus"  ) +// sent via -ldflags +var VERSION string +var BUILDTIME string +  //go:embed resources/*  var resToolkit embed.FS  | 
