summaryrefslogtreecommitdiff
path: root/Makefile
blob: 75e911c045d695e2c94322cdc7eedd51029d9f81 (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
VERSION = $(shell git describe --tags)

all:
	@echo "make run       # will build and run the daemon here"
	@echo "make debian    # will build a debian package"
	@echo "make restart   # restart the daemon"
	@echo "make enable    # enable daemon on boot"
	@echo "make log       # watch the daemon log"

log:
	@#systemctl status gowebd.service
	@journalctl -f -xeu gowebd.service

enable:
	systemctl enable gowebd.service

restart:
	systemctl stop gowebd.service
	systemctl start gowebd.service

run:
	git pull
	echo "build it!"
	GO111MODULE=off go build -v -x -ldflags "-X main.Version=${VERSION} -X gui.GUIVERSION=${VERSION}"
	./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:
	go-deb --no-gui --repo go.wit.com/apps/gowebd

squash-the-last-3-commits-together:
	git rebase -i HEAD~3
	git fsck
	git prune