-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
35 lines (27 loc) · 857 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
33
34
35
PREFIX=/usr/local
LIB32=lib32
LIB64=lib64
all: lib
lib: lib32/hax11.so lib64/hax11.so
lib32:
mkdir lib32
lib64:
mkdir lib64
lib32/hax11.so: lib32 common.c lib.c Makefile
gcc -m32 -Wall -Wextra -g lib.c -o $@ -fPIC -shared -ldl -D_GNU_SOURCE
lib64/hax11.so: lib64 common.c lib.c Makefile
gcc -m64 -Wall -Wextra -g lib.c -o $@ -fPIC -shared -ldl -D_GNU_SOURCE
server: common.c server.c
gcc -o server -lpthread server.c
install:
install -d $(PREFIX)/$(LIB32)/
install -d $(PREFIX)/$(LIB64)/
install -m 644 lib32/hax11.so $(PREFIX)/$(LIB32)/
install -m 644 lib64/hax11.so $(PREFIX)/$(LIB64)/
echo "export LD_PRELOAD=$(PREFIX)/\\\$$LIB/hax11.so " > /etc/profile.d/hax11.sh
chmod 755 /etc/profile.d/hax11.sh
uninstall:
rm -f $(PREFIX)/$(LIB32)/hax11.so
rm -f $(PREFIX)/$(LIB64)/hax11.so
rm -f /etc/profile.d/hax11.sh
.PHONY: all lib install