blob: 3c5e2eda95755be13f66282787b1fbf6d668a85e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
  | 
.PHONY: build
VERSION = $(shell git describe --tags)
BUILDTIME = $(shell date +%s)
default: placement.pb.go install
placement.pb.go: placement.proto
	make generate
generate: clean
	go mod init
	go mod tidy
	go generate
go-generate:
	rm -f *.pb.go *.patch
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
  |