summaryrefslogtreecommitdiff
path: root/Makefile
blob: 7414108f6ff211d33bcdbcd578d5ff64e3f044b7 (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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
.PHONY: build

VERSION = $(shell git describe --tags)
BUILDTIME = $(shell date +%s)

# create the go.mod and go.sum if this is a brand new repo
# REDOMOD = $(shell if [ -e go.mod ]; then  echo go.mod; else echo no go mod; fi)
REDOMOD = $(shell if [ -e go.sum ]; then  echo go.sum exists; else GO111MODULE= go mod init; GO111MODULE= go mod tidy; fi)

all: build
	./zookeeper list

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

nogui:
	./zookeeper --gui nocui

gocui: build
	./zookeeper --gui gocui

gocui-5000: build
	./zookeeper --gui gocui --port 5000

gocui-debugging: build
	./zookeeper --gui gocui --gui-file ~/go/src/go.wit.com/toolkits/gocui/gocui.so
	# ./zookeeper --gui gocui --gui-file ~/go/src/go.wit.com/toolkits/gocui/gocui.so  >/tmp/forge.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: goimports
	GO111MODULE=off go install \
		-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"

# this is for release builds using the go.mod files
release-build:
	@echo ${REDOMOD}
	go build -v -ldflags "-X main.VERSION=${VERSION} -X gui.GUIVERSION=${VERSION}"

# makes a .deb package
debian:
	go-deb --auto --repo go.wit.com/apps/zookeeper

goimports:
	goimports -w *.go

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

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

# git clone the sources and all the golang dependancies into ~/go/src
# if you don't have go-clone, you can get it from http://go.wit.com/
git-clone:
	go-clone --recursive go.wit.com/apps/zookeeper

http-toogle-ZOOD:
	curl --silent http://localhost:8080/flag?flag=ZOOD

http-list-machines:
	curl --silent http://localhost:8080/list

http-uptime:
	curl --silent http://localhost:8080/uptime