fix makefile. makefiles are awesome. always have one, but fuck makefiles

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-11-02 09:14:48 -05:00
parent 638539c840
commit 15fe83812b
1 changed files with 13 additions and 2 deletions

View File

@ -6,9 +6,16 @@ VERSION = $(shell git describe --tags)
# 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
PROTOGEN= $(shell if [ -e /usr/bin/protoc-gen-go ]; then echo probably wrong protoc-gen-go exists; else echo ok; fi)
PROTOGENLOCAL= $(shell if [ -e ~/go/bin/protoc-gen-go ]; then echo ~/go/bin/protoc-gen-go exists ok; else echo build the right one with: make protogen && exit 0; fi)
all:
@echo ${PROTOGEN}
@echo ${PROTOGENLOCAL}
make build
./virtigo --version
./virtigo --help
@echo build worked
build:
GO111MODULE=off go build -v -ldflags "-X main.Version=${VERSION} -X gui.GUIVERSION=${VERSION}"
@ -93,3 +100,7 @@ http-missing:
http-dumplibvirtxml:
curl --silent http://localhost:8080//dumplibvirtxml
protogen:
go-clone google.golang.org/protobuf
cd ~/go/src/google.golang.org/protobuf/cmd/protoc-gen-go && go install