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

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

all: goimports build
	./virtigod --version

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

verbose:
	GO111MODULE=off go build -v -x \
		-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}"

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

goimports:
	goimports -w *.go

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

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

# 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-src --no-work go.wit.com/apps/go-clone
	go-clone --recursive --go-src --no-work go.wit.com/lib/daemons/virtigod

start-pihole.wit.com-http:
	curl --silent http://localhost:8080/start?start=pihole.wit.com

start-bind.wit.com-http:
	curl --silent http://localhost:8080/start?start=bind.wit.com