-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
45 lines (32 loc) · 763 Bytes
/
Makefile
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
.PHONY: test clean doctest build docs doctest install-docs install-cmd install prof snap
MAN ?= /usr/bin/man
DOCSRC = doc/gdimmer.md
DOCOUT = doc/gdimmer.1.gz
DOCDIR ?= /usr/local/share/man/man1/
BINDIR = cmd/gdimmer
BINSRC = $(BINDIR)/main.go
BINOUT = $(BINDIR)/gdimmer
INSTALLOPTS = -D -o root -g root -m 0644
default: build;
test:
go test
prof:
go test -coverprofile=prof
go tool cover -html prof
clean:
$(RM) $(DOCOUT) $(BINOUT)
install: install-cmd install-docs
docs:
pandoc $(DOCSRC) -s -t man | gzip > $(DOCOUT)
build: docs
go build -o $(BINOUT) $(BINSRC)
doctest: docs
$(MAN) $(DOCOUT)
install-docs: docs
install $(INSTALLOPTS) $(DOCOUT) -t $(DOCDIR)
mandb
install-cmd:
cd $(BINDIR)
go install
snap:
snapcraft --use-lxd --debug