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

default: verbose

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

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

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

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

install-raw: goimports vet plugin
	go install \
		-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"

plugin:
	rm -f resources/*.so
	# -cp ../../toolkits/gocui/gocui.so resources/

andlabs: clean install
	gemini --gui gocui --gui-verbose --gui-file ../../toolkits/andlabs/andlabs.so

gocui: install
	gemini --gui gocui --gui-verbose --gui-file ../../toolkits/gocui/gocui.so >/tmp/gemini.log 2>&1

goimports:
	reset
	goimports -w *.go
	@# // to globally reset paths:
	@# // gofmt -w -r '"go.wit.com/gui/gadgets" -> "go.wit.com/lib/gadgets"' *.go

clean:
	-rm -f gemini go.*
	go-mod-clean purge

identify-protobuf:
	autogenpb --identify ~/.gemini/gemini.pb