From 6944de6d8509bc024bd1749913dcf0b4fcb97740 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sat, 16 Nov 2024 00:08:43 -0600 Subject: [PATCH] fix build --- Makefile | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/Makefile b/Makefile index 2050b4b..d604797 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,5 @@ 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) +BUILDTIME = $(shell date +%Y.%m.%d) all: build ./virtigoctl --version @@ -10,12 +7,16 @@ all: build make dump-droplets build: - GO111MODULE=off go build -v -ldflags "-X main.Version=${VERSION} -X gui.GUIVERSION=${VERSION}" + GO111MODULE=off go build \ + -ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -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}" +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}" # autofixes your import headers in your golang files goimports: @@ -31,14 +32,6 @@ 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 - dump-uptime: ./virtigoctl dump --uptime=true