2013-08-16 18:17:15 +08:00
|
|
|
CFLAGS = -W -Wall -I.. -pthread -g -pipe $(COPT)
|
2013-08-27 07:02:40 +08:00
|
|
|
DLL_FLAGS = -DLUA_COMPAT_ALL -I../build
|
2014-01-12 00:18:29 +08:00
|
|
|
RM = rm -rf
|
2010-05-04 04:46:42 +08:00
|
|
|
|
2013-08-16 18:17:15 +08:00
|
|
|
ifeq ($(OS),Windows_NT)
|
2014-01-12 00:18:29 +08:00
|
|
|
RM = del /q /f
|
2013-08-16 18:17:15 +08:00
|
|
|
else
|
|
|
|
UNAME_S := $(shell uname -s)
|
|
|
|
DLL_FLAGS += -shared
|
2012-09-25 04:25:06 +08:00
|
|
|
|
2013-08-16 18:17:15 +08:00
|
|
|
ifeq ($(UNAME_S),Linux)
|
|
|
|
CFLAGS += -ldl
|
|
|
|
endif
|
2012-09-25 04:25:06 +08:00
|
|
|
|
2013-08-16 18:17:15 +08:00
|
|
|
ifeq ($(UNAME_S),Darwin)
|
|
|
|
# DLL_FLAGS += -bundle -undefined dynamic_lookup -dynamiclib
|
|
|
|
DLL_FLAGS += -flat_namespace -undefined suppress -dynamiclib
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2013-12-16 21:33:50 +08:00
|
|
|
all:
|
|
|
|
$(CC) hello.c ../mongoose.c -o hello $(CFLAGS)
|
2013-12-18 17:33:59 +08:00
|
|
|
$(CC) qcomm.c ../mongoose.c -o qcomm $(CFLAGS)
|
2013-12-23 16:06:35 +08:00
|
|
|
$(CC) post.c ../mongoose.c -o post $(CFLAGS)
|
2013-12-26 18:13:04 +08:00
|
|
|
$(CC) multi_threaded.c ../mongoose.c -o multi_threaded $(CFLAGS)
|
2014-01-14 01:01:11 +08:00
|
|
|
$(CC) upload.c ../mongoose.c -o upload $(CFLAGS)
|
2014-01-14 01:58:14 +08:00
|
|
|
$(CC) auth.c ../mongoose.c -o auth $(CFLAGS)
|
2014-01-16 21:53:18 +08:00
|
|
|
$(CC) server.c ../mongoose.c -o server $(CFLAGS)
|
2013-12-16 21:33:50 +08:00
|
|
|
|
|
|
|
# $(CC) -DUSE_WEBSOCKET websocket.c ../mongoose.c -o $@ $(CFLAGS)
|
|
|
|
# $(CC) chat.c ../mongoose.c -o chat $(CFLAGS)
|
|
|
|
# $(CC) lua_dll.c ../build/lua_5.2.1.c -o $@.so $(CFLAGS) $(DLL_FLAGS)
|
2013-08-16 18:17:15 +08:00
|
|
|
|
|
|
|
|
|
|
|
MSVC = ../../vc6
|
2012-09-25 04:25:06 +08:00
|
|
|
CL = $(MSVC)/bin/cl
|
|
|
|
CLFLAGS = /MD /TC /nologo $(DBG) /W3 /DNO_SSL \
|
2013-08-16 18:17:15 +08:00
|
|
|
/I$(MSVC)/include /I.. /Dsnprintf=_snprintf
|
|
|
|
LFLAGS = /link /incremental:no /libpath:$(MSVC)/lib /machine:IX86
|
2012-09-25 04:25:06 +08:00
|
|
|
|
|
|
|
windows:
|
2013-08-16 18:17:15 +08:00
|
|
|
$(CL) hello.c ../mongoose.c $(CLFLAGS) $(LFLAGS)
|
2013-12-23 16:09:59 +08:00
|
|
|
$(CL) post.c ../mongoose.c $(CLFLAGS) $(LFLAGS)
|
2013-12-26 18:13:04 +08:00
|
|
|
$(CL) multi_threaded.c ../mongoose.c $(CLFLAGS) $(LFLAGS)
|
2014-01-14 01:01:11 +08:00
|
|
|
$(CL) upload.c ../mongoose.c $(CLFLAGS) $(LFLAGS)
|
2014-01-14 01:58:14 +08:00
|
|
|
$(CL) auth.c ../mongoose.c $(CLFLAGS) $(LFLAGS)
|
2014-01-16 21:53:18 +08:00
|
|
|
$(CL) server.c ../mongoose.c $(CLFLAGS) $(LFLAGS)
|
2014-01-14 01:01:11 +08:00
|
|
|
|
2013-12-18 17:33:59 +08:00
|
|
|
# $(CL) /DUSE_WEBSOCKET websocket.c ../mongoose.c $(CLFLAGS) $(LFLAGS)
|
2013-08-16 18:17:15 +08:00
|
|
|
#$(CL) lua_dll.c $(CLFLAGS) $(DLL_FLAGS) /DLL $(LFLAGS) /SUBSYSTEM:WINDOWS /ENTRY:luaopen_lua_dll /EXPORT:luaopen_lua_dll /out:lua_dll.dll
|
2012-10-14 22:00:04 +08:00
|
|
|
|
|
|
|
clean:
|
2014-01-12 00:18:29 +08:00
|
|
|
-@$(RM) hello upload post websocket chat *.exe *.dSYM *.obj .*o
|