-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
31 lines (23 loc) · 886 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
DESTDIR ?=
BINDIR ?= /usr/local/bin
SYSTEMDUNITDIR ?= /usr/local/lib/systemd/system
all:
@ echo "Use: make install, make uninstall"
install:
install -d $(DESTDIR)$(BINDIR)
install -m0755 mglru $(DESTDIR)$(BINDIR)/mglru
install -m0755 set_mglru $(DESTDIR)$(BINDIR)/set_mglru
install -m0755 set_min_ttl_ms $(DESTDIR)$(BINDIR)/set_min_ttl_ms
-install -d $(DESTDIR)$(SYSTEMDUNITDIR)
-sed "s|:TARGET_BIN:|$(BINDIR)|g" mglru.service.in > mglru.service
-install -m0644 mglru.service $(DESTDIR)$(SYSTEMDUNITDIR)/mglru.service
-chcon -t systemd_unit_file_t $(DESTDIR)$(SYSTEMDUNITDIR)/mglru.service
-rm -fv mglru.service
# Very nice!
uninstall:
-systemctl disable mglru.service || :
rm -fv $(DESTDIR)$(BINDIR)/mglru
rm -fv $(DESTDIR)$(BINDIR)/set_mglru
rm -fv $(DESTDIR)$(BINDIR)/set_min_ttl_ms
-rm -fv $(DESTDIR)$(SYSTEMDUNITDIR)/mglru.service
-systemctl daemon-reload