summaryrefslogtreecommitdiff
path: root/Makefile
blob: 4a031b75e0f6c4c71e78ee1cc8dd238d1b7d9d03 (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
VERSION = $(shell git describe --tags)
BUILDTIME = $(shell date +%s)

all: install

go-build: goimports
	GO111MODULE=off go build \
		-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"

install: goimports
	GO111MODULE=off go install \
		-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"

install-verbose: goimports
	GO111MODULE=off go install -v -x \
		-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"

generate: clean
	go mod init
	go mod tidy
	go generate

go-generate:
	rm -f *.pb.go *.patch

vet:
	@GO111MODULE=off go vet
	@echo this go library package builds okay

# autofixes your import headers in your golang files
goimports:
	goimports -w *.go

clean:
	rm -f *.pb.go *.patch
	-rm -f go.*
	-go-mod-clean purge