-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
23 lines (17 loc) · 837 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
SYSTEMD_DIR ?= $(wildcard /lib/systemd/system)
PREFIX ?= /usr/local
SBINDIR ?= $(PREFIX)/sbin
TEST_BIN := $(wildcard /bin/test)
TEST_BIN := $(if $(TEST_BIN),$(TEST_BIN),$(wildcard /usr/bin/test))
.PHONY: all install uninstall
all:
: "nothing to do, run make [PREFIX=..|SBINDIR=..] [SYSTEMD_DIR=..] install to install"
: "or make [PREFIX=..|SBINDIR=..] [SYSTEMD_DIR=..] uninstall to uninstall"
$(SBINDIR)/ocsp_proxy:
install -Dp -m0755 ocsp_proxy.pl $(DESTDIR)$@
$(SYSTEMD_DIR)/ocsp_proxy.service: systemd/ocsp_proxy.service
install -d $(DESTDIR)$(SYSTEMD_DIR)
sed -r -e 's|@@TEST_BIN@@|$(TEST_BIN)|;s|@@SBINDIR@@|$(SBINDIR)|g' $< > $(DESTDIR)$@
install: $(SBINDIR)/ocsp_proxy $(if $(SYSTEMD_DIR),$(SYSTEMD_DIR)/ocsp_proxy.service,)
uninstall:
rm -f $(DESTDIR)$(SYSTEMD_DIR)/ocsp_proxy.service $(DESTDIR)$(SBINDIR)/ocsp_proxy