diff --git a/Makefile b/Makefile index 3d9bb77..6a82c73 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,24 @@ -run: build +VERSION = $(shell git describe --tags) +BUILDTIME = $(shell date +%Y.%m.%d) + +all: build ./control-panel-cloudflare +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 \ + -ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}" + +clean: + -rm -f control-panel-cloudflare + goimports: goimports -w *.go @@ -18,9 +36,6 @@ build-and-update: goget: go get -v -x . -build: - go build -v -o control-panel-cloudflare - update: GO111MODULE="off" go get -v -u -x . diff --git a/main.go b/main.go index c68c763..8e5634f 100644 --- a/main.go +++ b/main.go @@ -13,9 +13,6 @@ var myGui *gui.Node // var cloudflareURL string = "https://api.cloudflare.com/client/v4/zones/" func main() { - // send all log() output to a file in /tmp - // log.SetTmp() - // parse the config file readConfig()