-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (26 loc) · 961 Bytes
/
Makefile
File metadata and controls
35 lines (26 loc) · 961 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
30
31
32
33
34
35
all: build
GIT_COMMIT:=$(shell git rev-list -1 HEAD)
GIT_LAST_TAG:=$(shell git describe --abbrev=0 --tags)
GIT_EXACT_TAG:=$(shell git name-rev --name-only --tags HEAD)
VERSION_PATH:=github.com/guttermonk/bleamd
LDFLAGS:=-X main.GitCommit=${GIT_COMMIT} \
-X main.GitLastTag=${GIT_LAST_TAG} \
-X main.GitExactTag=${GIT_EXACT_TAG}
PREFIX ?= /usr/local
DESTDIR ?=
BINDIR := $(DESTDIR)$(PREFIX)/bin
ICONDIR := $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps
APPDIR := $(DESTDIR)$(PREFIX)/share/applications
build:
go build -ldflags "$(LDFLAGS)" .
install: build
install -Dm755 bleamd $(BINDIR)/bleamd
install -Dm644 bleamd-icon.svg $(ICONDIR)/bleamd-icon.svg
install -Dm644 bleamd.desktop $(APPDIR)/bleamd.desktop
uninstall:
rm -f $(BINDIR)/bleamd
rm -f $(ICONDIR)/bleamd-icon.svg
rm -f $(APPDIR)/bleamd.desktop
releases:
gox -ldflags "$(LDFLAGS)" -output "dist/{{.Dir}}_{{.OS}}_{{.Arch}}"
.PHONY: build install uninstall releases