forked from cloudwu/skynet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
92 lines (71 loc) · 2.62 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
.PHONY : all clean
CFLAGS = -g -Wall
SHARED = -fPIC --shared
LUALIB = -llua
all : \
skynet \
service/snlua.so \
service/logger.so \
service/gate.so \
service/client.so \
service/connection.so \
service/master.so \
service/multicast.so \
service/tunnel.so \
service/harbor.so \
service/localcast.so \
luaclib/skynet.so \
luaclib/socket.so \
luaclib/int64.so \
luaclib/mcast.so \
client
skynet : \
skynet-src/skynet_main.c \
skynet-src/skynet_handle.c \
skynet-src/skynet_module.c \
skynet-src/skynet_mq.c \
skynet-src/skynet_server.c \
skynet-src/skynet_start.c \
skynet-src/skynet_timer.c \
skynet-src/skynet_error.c \
skynet-src/skynet_harbor.c \
skynet-src/skynet_multicast.c \
skynet-src/skynet_group.c \
skynet-src/skynet_env.c \
skynet-src/skynet_monitor.c \
luacompat/compat52.c
gcc $(CFLAGS) -Iluacompat -Wl,-E -o $@ $^ -Iskynet-src -lpthread -ldl -lrt -Wl,-E $(LUALIB) -lm
luaclib:
mkdir luaclib
service/tunnel.so : service-src/service_tunnel.c
gcc $(CFLAGS) $(SHARED) $^ -o $@ -Iskynet-src
service/multicast.so : service-src/service_multicast.c
gcc $(CFLAGS) $(SHARED) $^ -o $@ -Iskynet-src
service/master.so : service-src/service_master.c
gcc $(CFLAGS) $(SHARED) $^ -o $@ -Iskynet-src
service/harbor.so : service-src/service_harbor.c
gcc $(CFLAGS) $(SHARED) $^ -o $@ -Iskynet-src
service/logger.so : skynet-src/skynet_logger.c
gcc $(CFLAGS) $(SHARED) $^ -o $@ -Iskynet-src
service/snlua.so : service-src/service_lua.c
gcc $(CFLAGS) $(SHARED) -Iluacompat $^ -o $@ -Iskynet-src
service/gate.so : gate/mread.c gate/ringbuffer.c gate/main.c
gcc $(CFLAGS) $(SHARED) $^ -o $@ -Igate -Iskynet-src
service/localcast.so : service-src/service_localcast.c
gcc $(CFLAGS) $(SHARED) $^ -o $@ -Iskynet-src
luaclib/skynet.so : lualib-src/lua-skynet.c lualib-src/lua-seri.c lualib-src/lua-remoteobj.c lualib-src/trace_service.c | luaclib
gcc $(CFLAGS) $(SHARED) -Iluacompat $^ -o $@ -Iskynet-src -Ilualib-src
service/client.so : service-src/service_client.c
gcc $(CFLAGS) $(SHARED) $^ -o $@ -Iskynet-src
service/connection.so : connection/connection.c connection/main.c
gcc $(CFLAGS) $(SHARED) $^ -o $@ -Iskynet-src -Iconnection
luaclib/socket.so : connection/lua-socket.c | luaclib
gcc $(CFLAGS) $(SHARED) -Iluacompat $^ -o $@ -Iskynet-src -Iconnection
luaclib/int64.so : lua-int64/int64.c | luaclib
gcc $(CFLAGS) $(SHARED) -Iluacompat -O2 $^ -o $@
luaclib/mcast.so : lualib-src/lua-localcast.c | luaclib
gcc $(CFLAGS) $(SHARED) -Iluacompat $^ -o $@ -Iskynet-src -Iservice-src
client : client-src/client.c
gcc $(CFLAGS) $^ -o $@ -lpthread
clean :
rm skynet client service/*.so luaclib/*.so