summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile36
1 files changed, 24 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index ac78871..81f97b6 100644
--- a/Makefile
+++ b/Makefile
@@ -1,21 +1,34 @@
VERSION = $(shell git describe --tags)
+BUILDTIME = $(shell date +%Y.%m.%d)
-all:
- -rm resources/*.so
- touch resources/blank.so
- -cp -a ~/go/src/go.wit.com/toolkits/*.so resources/ # embed the toolkit plugins in the binary
- GO111MODULE=off go build -v -x \
- -ldflags "-X main.VERSION=${VERSION}"
+all: build
./helloworld
+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 -v -x \
- -ldflags "-X main.VERSION=${VERSION}"
- ./helloworld
+ GO111MODULE=off go install \
+ -ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
+
+clean:
+ -rm -f gadgetwindow
+ -rm resources/*.so
+ touch resources/blank.so
+
+# 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/
gocui:
- GO111MODULE=off go build -v -x
- ./helloworld --gui gocui >/tmp/helloworld.stdout 2>&1
+ ./helloworld --gui gocui
goimports:
goimports -w *.go
@@ -25,4 +38,3 @@ redomod:
goimports -w *.go
GO111MODULE= go mod init
GO111MODULE= go mod tidy
-