compiles on macosx

This commit is contained in:
Yecheng Fu
2012-11-27 20:07:50 +08:00
parent b6314b537f
commit 8f29655d25
6 changed files with 232 additions and 28 deletions

View File

@@ -1,8 +1,15 @@
.PHONY : all clean
CFLAGS = -g -Wall
SHARED = -fPIC --shared
LUALIB = -llua
LDFLAGS = -lpthread -llua -ldl -lm
uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
ifeq ($(uname_S), Darwin)
SHARED = -fPIC -dynamiclib -Wl,-undefined,dynamic_lookup
else
LDFLAGS += -ldl -lrt -Wl,-E
SHARED = -fPIC --shared
endif
all : \
skynet \
@@ -37,7 +44,7 @@ skynet : \
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
gcc $(CFLAGS) -Iluacompat -o $@ $^ -Iskynet-src $(LDFLAGS)
luaclib:
mkdir luaclib
@@ -89,4 +96,4 @@ client : client-src/client.c
clean :
rm skynet client service/*.so luaclib/*.so