summaryrefslogtreecommitdiff
path: root/Makefile
blob: ad8155e7520e2956f0616262f69faccf28190ae6 (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
.PHONY: build

VERSION = $(shell git describe --tags)
BUILDTIME = $(shell date +%Y.%m.%d_%H%M)

all: portmap.pb.go build
	./gus --version
	./gus --no-gui --config /etc/gus/gus.text

gocui: build
	./gus --gui gocui --config /etc/gus/gus.text >/tmp/gocui.log 2>&1

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

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

sudo: build
	sudo ./gus

# makes a .deb package
debian:
	go-deb --repo go.wit.com/lib/daemons/gus

goimports:
	goimports -w *.go

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

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

portmap.pb.go: portmap.proto
	autogenpb --proto portmap.proto

list:
	curl "http://localhost:2522/list"

save:
	curl "http://localhost:2522/save"