zood/Makefile

48 lines
1.2 KiB
Makefile
Raw Permalink Normal View History

2024-11-15 19:25:24 -06:00
.PHONY: build
2024-11-15 01:22:47 -06:00
VERSION = $(shell git describe --tags)
2024-11-15 13:40:07 -06:00
BUILDTIME = $(shell date +%Y.%m.%d_%H%M)
2024-11-15 01:22:47 -06:00
# 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-11-15 19:25:24 -06:00
all: build
./zood --version
./zood
build:
2024-11-15 13:40:07 -06:00
GO111MODULE=off go build \
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
2024-11-15 19:25:24 -06:00
install:
GO111MODULE=off go install \
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
2024-11-15 01:22:47 -06:00
2024-11-16 13:51:25 -06:00
sudo: build
sudo ./zood
2024-11-15 01:22:47 -06:00
# makes a .deb package
debian:
2024-11-16 13:51:25 -06:00
go-deb --auto --repo go.wit.com/lib/daemons/zood
2024-11-15 01:22:47 -06:00
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