-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
37 lines (30 loc) · 990 Bytes
/
Makefile
File metadata and controls
37 lines (30 loc) · 990 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
36
37
CC ?= cc
CFLAGS ?= -O2 -pipe
CFLAGS += -Wall -Wextra -Werror -pedantic -std=c99
PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin
MANDIR ?= $(PREFIX)/share/man
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)/
install -d $(DESTDIR)$(MANDIR)/man8
install -m 644 thinproxy.8 $(DESTDIR)$(MANDIR)/man8/
@if [ -d /etc/rc.d ]; then \
install -d $(DESTDIR)/etc/rc.d; \
install -m 755 openbsd/rc.d/thinproxy $(DESTDIR)/etc/rc.d/; \
elif [ -d /lib/systemd ] || [ -n "$(DESTDIR)" ]; then \
install -d $(DESTDIR)$(UNITDIR); \
install -m 644 thinproxy.service $(DESTDIR)$(UNITDIR)/; \
fi
uninstall:
rm -f $(DESTDIR)$(BINDIR)/thinproxy
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