-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (27 loc) · 859 Bytes
/
Makefile
File metadata and controls
35 lines (27 loc) · 859 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
# Installation paths
PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin
SYSCONFDIR := $(PREFIX)/etc
# Compilers and tools
GO ?= go
# Build-time variables
VERSION ?= $(shell git describe --tags --dirty)
build:
mkdir -p build
cd src; $(GO) build -ldflags "-w -X 'main.StormfetchVersion=$(VERSION)' -X 'main.SystemConfigDir=$(SYSCONFDIR)'" -o ../build/stormfetch stormfetch
install: build/stormfetch config/
# Create directoriy
install -dm755 $(DESTDIR)$(BINDIR)
# Install binary
install -m755 build/stormfetch $(DESTDIR)$(BINDIR)/stormfetch
install-config:
# Create directory
install -dm755 $(DESTDIR)$(SYSCONFDIR)
# Install files
cp -r config $(DESTDIR)$(SYSCONFDIR)/stormfetch/
uninstall:
-rm -f $(DESTDIR)$(BINDIR)/stormfetch
-rm -rf $(DESTDIR)$(SYSCONFDIR)/stormfetch
clean:
rm -r build/
.PHONY: build install install-config uninstall clean