-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
36 lines (29 loc) · 1004 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
VERSION?=$(shell git describe --tags)
GITCOMMIT=$(shell git rev-parse --verify --short HEAD)
BUILDTIME=$(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
.PHONY: all
all: test build
.PHONY: build
build: hamdeck
.PHONY: test
test:
go test ./... -v
.PHONY: clean
clean:
-@rm ./hamdeck
.PHONY: install
install: hamdeck
cp ./hamdeck /usr/bin/hamdeck
mkdir -p /usr/share/hamdeck
cp ./example_conf.json /usr/share/hamdeck/example_conf.json
cp ./.debpkg/lib/systemd/system/hamdeck.service /lib/systemd/system/hamdeck.service
cp ./.debpkg/lib/udev/rules.d/99-hamdeck.rules /lib/udev/rules.d/99-hamdeck.rules
.PHONY: uninstall
uninstall:
-rm /usr/bin/hamdeck
-rm /usr/share/hamdeck/example_conf.json
-rmdir /usr/share/hamdeck
-rm /lib/systemd/system/hamdeck.service
-rm /lib/udev/rules.d/99-hamdeck.rules
hamdeck:
go build -v -o hamdeck -ldflags "-X github.com/ftl/hamdeck/cmd.version=$(VERSION) -X github.com/ftl/hamdeck/cmd.gitCommit=$(GITCOMMIT) -X github.com/ftl/hamdeck/cmd.buildTime=$(BUILDTIME)" .