-
Notifications
You must be signed in to change notification settings - Fork 56
/
Copy pathMakefile
35 lines (21 loc) · 1.05 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
include skynet/platform.mk
CC ?= gcc
SHARED := -fPIC --shared
LUA_CLIB_PATH ?= ./skynet/luaclib
SKYNET_BUILD_PATH ?= ./skynet
CFLAGS = -g -O2 -Wall -I$(LUA_INC)
LUA_STATICLIB := ./skynet/3rd/lua/liblua.a
LUA_LIB ?= $(LUA_STATICLIB)
LUA_INC ?= ./skynet/3rd/lua
LUA_CLIB = cjson websocketnetpack clientwebsocket lfs
all : $(LUA_CLIB_PATH)/cjson.so $(LUA_CLIB_PATH)/websocketnetpack.so $(LUA_CLIB_PATH)/clientwebsocket.so $(LUA_CLIB_PATH)/lfs.so
$(LUA_CLIB_PATH)/cjson.so : lua-cjson/fpconv.c lua-cjson/strbuf.c lua-cjson/lua_cjson.c | $(LUA_CLIB_PATH)
$(CC) $(CFLAGS) $(SHARED) -Ilua-cjson $^ -o $@
$(LUA_CLIB_PATH)/websocketnetpack.so : lualib-src/lua-websocketnetpack.c | $(LUA_CLIB_PATH)
$(CC) $(CFLAGS) $(SHARED) -I$(SKYNET_BUILD_PATH)/skynet-src $^ -o $@
$(LUA_CLIB_PATH)/clientwebsocket.so : lualib-src/lua-clientwebsocket.c | $(LUA_CLIB_PATH)
$(CC) $(CFLAGS) $(SHARED) $^ -o $@ -lpthread
$(LUA_CLIB_PATH)/lfs.so : luafilesystem/src/lfs.c | $(LUA_CLIB_PATH)
$(CC) $(CFLAGS) $(SHARED) -Iluafilesystem/src $^ -o $@
clean :
rm -f $(LUA_CLIB_PATH)/*.so