Don't overwrite existing config on make install
[proxy] / Makefile
1 VERSION := 0.2
2 PREFIX := /usr/local
3 CFLAGS += -Wall -Wextra -Werror -std=c99 -DVERSION='"$(VERSION)"'
4 LDFLAGS += -lpthread -lbsd
5
6 socks5server: socks5server.c
7 $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
8
9 test: socks5server
10 ./test_proxy.py
11
12 install: socks5server
13 install -m 0755 -D -t $(PREFIX)/bin socks5server
14 [ -f $(PREFIX)/etc/socks5server.conf ] || install -m 0644 -D -t $(PREFIX)/etc socks5server.conf
15 install -m 0644 -D -t $(PREFIX)/lib/systemd/system socks5server.service
16 sed -i 's|PREFIX|$(PREFIX)|g' $(PREFIX)/lib/systemd/system/socks5server.service
17
18 clean:
19 rm -f socks5server
20
21 .PHONY: clean install test