summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile35
1 files changed, 21 insertions, 14 deletions
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