-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
31 lines (21 loc) · 867 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
INC=include
LIB=lib
SRC=src
none :
server : Server.c dtp
gcc -Wall -std=c99 -Iinclude Server.c -o server -Wl,-R,lib -Llib -ldtp -lpthread
client : Client.c dtp
gcc -Wall -std=c99 -Iinclude Client.c -o client -Wl,-R,lib -Llib -ldtp -lpthread
dtp : $(LIB)/libdtp.so
$(LIB)/libdtp.so : $(LIB)/libgate.o $(LIB)/libdmn.o $(LIB)/libconn.o $(LIB)/libpacket.o
gcc -Wall -shared -fPIC $^ -Wl,-soname,libdtp.so -o $@
$(LIB)/libgate.o : $(SRC)/gate.c $(INC)/gate.h $(INC)/packet.h
gcc -Wall -c -fPIC -I$(INC) $< -o $@
$(LIB)/libdmn.o : $(SRC)/daemons.c $(INC)/gate.h $(INC)/packet.h
gcc -Wall -c -fPIC -I$(INC) $< -o $@
$(LIB)/libconn.o : $(SRC)/connect.c $(INC)/gate.h $(INC)/packet.h
gcc -Wall -c -fPIC -I$(INC) $< -o $@
$(LIB)/libpacket.o : $(INC)/packet.h $(SRC)/packet.c
gcc -Wall -c -fPIC -I$(INC) $(SRC)/packet.c -o $@
clean :
rm -f lib/* server client