-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
43 lines (38 loc) · 1.18 KB
/
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
.PHONY: all
all: tkey-runapp
DESTDIR=/
PREFIX=/usr/local
UDEVDIR=/etc/udev
destbin=$(DESTDIR)/$(PREFIX)/bin
destrules=$(DESTDIR)/$(UDEVDIR)/rules.d
.PHONY: install
install:
install -Dm755 tkey-runapp $(destbin)/tkey-runapp
strip $(destbin)/tkey-runapp
install -Dm755 run-tkey-qemu $(destbin)/run-tkey-qemu
install -Dm644 system/60-tkey.rules $(destrules)/60-tkey.rules
.PHONY: uninstall
uninstall:
rm -f \
$(destbin)/tkey-runapp \
$(destbin)/run-tkey-qemu \
$(destrules)/60-tkey.rules \
.PHONY: reload-rules
reload-rules:
udevadm control --reload
udevadm trigger
podman:
podman run --rm --mount type=bind,source=$(CURDIR),target=/src --mount type=bind,source=$(CURDIR)/../tkey-libs,target=/tkey-libs -w /src -it ghcr.io/tillitis/tkey-builder:2 make -j
TKEY_RUNAPP_VERSION ?= $(shell git describe --dirty --always | sed -n "s/^v\(.*\)/\1/p")
# .PHONY to let go-build handle deps and rebuilds
.PHONY: tkey-runapp
tkey-runapp:
go build -ldflags "-w -X main.version=$(TKEY_RUNAPP_VERSION) -buildid=" -trimpath ./cmd/tkey-runapp
.PHONY: clean
clean:
rm -f tkey-runapp
.PHONY: lint
lint:
$(MAKE) -C gotools
GOOS=linux ./gotools/golangci-lint run
GOOS=windows ./gotools/golangci-lint run