-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
34 lines (26 loc) · 965 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
PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin
LIBEXECDIR ?= $(PREFIX)/lib
SERVICE_USER ?= localtimed
GO111MODULE = on
TARGETS = localtimed localtime.service localtime.sysusers polkit.rules localtime-geoclue-agent.service
.PHONY: all clean install-user install
all: $(TARGETS)
clean:
-rm -f $(TARGETS)
install-user:
useradd -r -U localtimed
install: all
install -Dm755 localtimed $(DESTDIR)$(BINDIR)/localtimed
install -Dm644 polkit.rules $(DESTDIR)$(PREFIX)/share/polkit-1/rules.d/40-localtime.rules
install -Dm644 localtime.service $(DESTDIR)$(PREFIX)/lib/systemd/system/localtime.service
install -Dm644 localtime.sysusers $(DESTDIR)$(PREFIX)/lib/sysusers.d/localtime.conf
install -Dm644 localtime-geoclue-agent.service $(DESTDIR)$(PREFIX)/lib/systemd/system/localtime-geoclue-agent.service
%: %.in
m4 -DBINDIR="$(BINDIR)" \
-DLIBEXECDIR="$(LIBEXECDIR)" \
-DPREFIX="$(PREFIX)" \
-DUSER="$(SERVICE_USER)" \
$< > $@
%: %.go
go build -o $@ $<