forked from Ooooze/batctl
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
29 lines (22 loc) · 875 Bytes
/
Makefile
File metadata and controls
29 lines (22 loc) · 875 Bytes
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
PREFIX ?= /usr
BINDIR ?= $(PREFIX)/bin
SYSCONFDIR ?= /etc
BINARY = batctl
MODULE = github.com/Ooooze/batctl
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
LDFLAGS = -s -w -X main.version=$(VERSION)
.PHONY: all build install uninstall clean
all: build
build:
go build -ldflags "$(LDFLAGS)" -o $(BINARY) ./cmd/batctl/
install: build
install -Dm755 $(BINARY) $(DESTDIR)$(BINDIR)/$(BINARY)
install -Dm644 configs/batctl.service $(DESTDIR)$(SYSCONFDIR)/systemd/system/batctl.service
install -Dm644 configs/batctl-resume.service $(DESTDIR)$(SYSCONFDIR)/systemd/system/batctl-resume.service
uninstall:
rm -f $(DESTDIR)$(BINDIR)/$(BINARY)
rm -f $(DESTDIR)$(SYSCONFDIR)/systemd/system/batctl.service
rm -f $(DESTDIR)$(SYSCONFDIR)/systemd/system/batctl-resume.service
rm -f $(DESTDIR)$(SYSCONFDIR)/batctl.conf
clean:
rm -f $(BINARY)