forked from folkertvanheusden/tcpconsole
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
32 lines (24 loc) · 746 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
32
VERSION=1.0
DEBUG=-g -D_DEBUG
LDFLAGS+=$(DEBUG)
CFLAGS+=-Os -Wall -Wextra -DVERSION=\"$(VERSION)\" $(DEBUG)
OBJS=error.o tc.o
all: tcpconsole tcpconsole.pw
tcpconsole: $(OBJS)
$(CC) -Wall -W $(OBJS) $(LDFLAGS) -o tcpconsole
tcpconsole.pw:
tr -dc A-Za-z0-9 < /dev/urandom | head -c 8 > tcpconsole.pw
install: tcpconsole tcpconsole.pw
install tcpconsole -m0700 -t /usr/local/sbin
install tcpconsole.pw -m0600 -t /etc
install tcpconsole.service -t /etc/systemd/system
systemctl enable tcpconsole
systemctl start tcpconsole
uninstall:
rm /usr/local/sbin/tcpconsole
rm /etc/systemd/system/tcpconsole.service
rm /etc/tcpconsole.pw
systemctl stop tcpconsole
systemctl daemon-reload
clean:
rm -f $(OBJS) core tcpconsole tcpconsole.pw