summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-10-30 02:28:53 -0500
committerJeff Carr <[email protected]>2024-10-30 02:28:53 -0500
commit73b81913fa941504dfd2aa84fab9692b34fdcff6 (patch)
treee63dcac97b103498428e0698f75f05eb9425f451 /Makefile
initial commitv0.0.1
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile39
1 files changed, 39 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..90dc4ff
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,39 @@
+VERSION = $(shell git describe --tags)
+
+# create the go.mod and go.sum if this is a brand new repo
+# REDOMOD = $(shell if [ -e go.mod ]; then echo go.mod; else echo no go mod; fi)
+REDOMOD = $(shell if [ -e go.sum ]; then echo go.sum exists; else GO111MODULE= go mod init; GO111MODULE= go mod tidy; fi)
+
+all: build
+ ./virtigoctl --version
+ ./virtigoctl --help
+
+build:
+ GO111MODULE=off go build -v -ldflags "-X main.Version=${VERSION} -X gui.GUIVERSION=${VERSION}"
+
+# this is for release builds using the go.mod files
+release-build:
+ @echo ${REDOMOD}
+ go build -v -ldflags "-X main.Version=${VERSION} -X gui.GUIVERSION=${VERSION}"
+
+# autofixes your import headers in your golang files
+goimports:
+ goimports -w *.go
+
+# remake the go.mod and go.sum files
+redomod:
+ rm -f go.*
+ GO111MODULE= go mod init
+ GO111MODULE= go mod tidy
+
+clean:
+ rm -f go.*
+ rm -f virtigo*
+
+# git clone the sources and all the golang dependancies into ~/go/src
+# if you don't have go-clone, you can get it from http://go.wit.com/
+git-clone:
+ go-clone --recursive --go-src --no-work go.wit.com/apps/go-clone
+ go-clone --recursive --go-src --no-work go.wit.com/apps/virtigo
+ go-clone --recursive --go-src --no-work go.wit.com/apps/gowebd
+ go-clone --recursive --go-src --no-work go.wit.com/lib/daemons/virtigod