-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
59 lines (52 loc) · 1.47 KB
/
Copy pathMakefile
File metadata and controls
59 lines (52 loc) · 1.47 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
CC ?= cc
CFLAGS ?= -O2 -pipe
CFLAGS += -Wall -Wextra -Werror -pedantic -std=c99
PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin
# MANDIR is computed per-OS at install time when left empty (OpenBSD uses
# $(PREFIX)/man, others $(PREFIX)/share/man); set it to override.
MANDIR ?=
UNITDIR ?= /lib/systemd/system
all: thinproxy
thinproxy: thinproxy.c
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ thinproxy.c
install: thinproxy
install -d $(DESTDIR)$(BINDIR)
install -m 755 thinproxy $(DESTDIR)$(BINDIR)/
@mandir="$(MANDIR)"; \
if [ -z "$$mandir" ]; then \
case "`uname -s`" in \
OpenBSD) mandir="$(PREFIX)/man";; \
*) mandir="$(PREFIX)/share/man";; \
esac; \
fi; \
install -d "$(DESTDIR)$$mandir/man8"; \
install -m 644 thinproxy.8 "$(DESTDIR)$$mandir/man8/"
@case "`uname -s`" in \
OpenBSD) \
install -d $(DESTDIR)/etc/rc.d; \
install -m 755 openbsd/rc.d/thinproxy $(DESTDIR)/etc/rc.d/; \
;; \
Linux) \
install -d $(DESTDIR)$(UNITDIR); \
install -m 644 thinproxy.service $(DESTDIR)$(UNITDIR)/; \
;; \
*) \
echo "no service file for `uname -s`; install manually"; \
;; \
esac
uninstall:
rm -f $(DESTDIR)$(BINDIR)/thinproxy
@mandir="$(MANDIR)"; \
if [ -z "$$mandir" ]; then \
case "`uname -s`" in \
OpenBSD) mandir="$(PREFIX)/man";; \
*) mandir="$(PREFIX)/share/man";; \
esac; \
fi; \
rm -f "$(DESTDIR)$$mandir/man8/thinproxy.8"
rm -f $(DESTDIR)/etc/rc.d/thinproxy
rm -f $(DESTDIR)$(UNITDIR)/thinproxy.service
clean:
rm -f thinproxy
.PHONY: all install uninstall clean