gowebd/Makefile

71 lines
1.6 KiB
Makefile

.PHONY: build
VERSION = $(shell git describe --tags)
BUILDTIME = $(shell date +%Y.%m.%d)
all: build
@echo "make build # build"
@echo "make clean # clean build files"
@echo "make run # build and run on port 2233"
@echo "make debian # will build a debian package"
@echo ""
@echo "make restart # restart the daemon"
@echo "make enable # enable daemon on boot"
@echo "make log # watch the daemon log"
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}"
log:
@#systemctl status gowebd.service
@journalctl -f -xeu gowebd.service
enable:
systemctl enable gowebd.service
restart:
systemctl stop gowebd.service
systemctl start gowebd.service
start:
systemctl start gowebd.service
stop:
systemctl stop gowebd.service
run: build
./gowebd --port 2233
# setcap 'cap_net_bind_service=+ep' gowebd # allow the binary to open ports below 1024
goimports:
goimports -w *.go
redomod:
rm -f go.*
GO111MODULE= go mod init
GO111MODULE= go mod tidy
clean:
rm -f go.*
rm -f go.wit.com
rm -f gowebd
# makes a .deb package
debian:
rm ~/incoming/gowebd*.deb
go-deb --no-gui --keep-files --repo go.wit.com/apps/gowebd
squash-the-last-3-commits-together:
git rebase -i HEAD~3
git fsck
git prune