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