47 lines
1.1 KiB
Makefile
47 lines
1.1 KiB
Makefile
.PHONY: build
|
|
|
|
VERSION = $(shell git describe --tags)
|
|
BUILDTIME = $(shell date +%Y.%m.%d)
|
|
|
|
default: placement.pb.go install
|
|
|
|
build:
|
|
GO111MODULE=off go build \
|
|
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
|
|
./startxplacement
|
|
|
|
install: goimports
|
|
GO111MODULE=off go install \
|
|
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
|
|
|
|
install-verbose: goimports vet
|
|
GO111MODULE=off go install -v -x \
|
|
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
|
|
|
|
# makes a .deb package
|
|
debian:
|
|
rm -f ~/incoming/virtigo*deb
|
|
go-deb --no-gui --repo go.wit.com/apps/virtigo
|
|
|
|
# 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 *.pb.go
|
|
rm -f startxplacement*
|
|
|
|
vet:
|
|
GO111MODULE=off go vet
|
|
@echo 'go vet' worked for this application
|
|
|
|
placement.pb.go: placement.proto
|
|
autogenpb --proto placement.proto
|