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

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

# 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
	./zood --version
	./zood

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

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

sudo: build
	sudo ./zood

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

goimports:
	goimports -w *.go

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

clean:
	rm -f go.*
	rm -f zood

# 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/lib/daemons/zood

http-list-packages:
	curl --silent http://localhost:2521/list?hostname=zookeeper.wit.com

localhost:
	./zood --port 2232 --url "http://localhost:2233"