virtigod/Makefile

42 lines
1.2 KiB
Makefile
Raw Normal View History

VERSION = $(shell git describe --tags)
# 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)
2024-10-11 17:22:31 -05:00
all:
GO111MODULE=off go build -v -x -ldflags "-X main.Version=${VERSION} -X gui.GUIVERSION=${VERSION}"
./virtigod --version
# sudo ./virtigod
# 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}"
2024-10-11 17:22:31 -05:00
# makes a .deb package
debian:
go-deb --no-gui --repo go.wit.com/lib/daemons/virtigod
2024-10-11 17:22:31 -05:00
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:
rm -f /tmp/pihole.wit.com.xml
./virtigod --start pihole.wit.com