summaryrefslogtreecommitdiff
path: root/Makefile
blob: 97ef344c24e8f7ae53f4859ae6735553fc4f8ede (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
VERSION = $(shell git describe --tags)
BUILDTIME = $(shell date +%Y.%m.%d_%H%M)

test: goimports build test

full: clean goimports auto vet install

vet:
	@GO111MODULE=off go vet
	@echo this go binary package should build okay

cleanbuild:
	rm -f auto.marshal.pb.go auto.sort.pb.go autogenpb

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

bak:
	mv -f autogenpb autogenpb.last

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

auto:
	rm -f auto.pb.go
	./autogenpb --proto file.proto --package main
	rm -f auto.sort.pb.go auto.newsort.pb.go # auto.marshal.pb.go

test:
	make -C example full

junk:
	cd example; rm -f go.* *.pb.go
	cd example; ../autogenpb --proto file.proto --package yellow
	cd example; GO111MODULE=off go vet

goimports:
	goimports -w *.go

redomod:
	rm -f go.*
	GO111MODULE= go mod init
	GO111MODULE= go mod tidy
	go mod edit -go=1.20

reset:
	-rm -f auto.sort.pb.go

clean:
	-rm -f go.*
	-rm -f *.pb.go
	-rm -f autogenpb