mongoose/examples/Makefile

57 lines
1.5 KiB
Makefile
Raw Normal View History

2013-08-16 11:17:15 +01:00
CFLAGS = -W -Wall -I.. -pthread -g -pipe $(COPT)
DLL_FLAGS = -DLUA_COMPAT_ALL -I../build
2013-08-16 11:17:15 +01:00
ifeq ($(OS),Windows_NT)
else
UNAME_S := $(shell uname -s)
DLL_FLAGS += -shared
2012-09-24 21:25:06 +01:00
2013-08-16 11:17:15 +01:00
ifeq ($(UNAME_S),Linux)
CFLAGS += -ldl
endif
2012-09-24 21:25:06 +01:00
2013-08-16 11:17:15 +01:00
ifeq ($(UNAME_S),Darwin)
# DLL_FLAGS += -bundle -undefined dynamic_lookup -dynamiclib
DLL_FLAGS += -flat_namespace -undefined suppress -dynamiclib
endif
endif
all: hello upload post websocket chat
2013-08-16 11:17:15 +01:00
hello:
$(CC) hello.c ../mongoose.c -o $@ $(CFLAGS)
2013-08-16 11:17:15 +01:00
upload:
$(CC) upload.c ../mongoose.c -o $@ $(CFLAGS)
2013-08-16 11:17:15 +01:00
post:
$(CC) post.c ../mongoose.c -o $@ $(CFLAGS)
2013-08-16 11:17:15 +01:00
websocket:
$(CC) -DUSE_WEBSOCKET websocket.c ../mongoose.c -o $@ $(CFLAGS)
2013-08-16 11:17:15 +01:00
chat:
$(CC) chat.c ../mongoose.c -o $@ $(CFLAGS)
2013-08-16 11:17:15 +01:00
lua_dll:
$(CC) lua_dll.c ../build/lua_5.2.1.c -o $@.so $(CFLAGS) $(DLL_FLAGS)
2013-08-16 11:17:15 +01:00
MSVC = ../../vc6
2012-09-24 21:25:06 +01:00
CL = $(MSVC)/bin/cl
CLFLAGS = /MD /TC /nologo $(DBG) /W3 /DNO_SSL \
2013-08-16 11:17:15 +01:00
/I$(MSVC)/include /I.. /Dsnprintf=_snprintf
LFLAGS = /link /incremental:no /libpath:$(MSVC)/lib /machine:IX86
2012-09-24 21:25:06 +01:00
windows:
2013-08-16 11:17:15 +01:00
$(CL) upload.c ../mongoose.c $(CLFLAGS) $(LFLAGS)
$(CL) hello.c ../mongoose.c $(CLFLAGS) $(LFLAGS)
$(CL) upload.c ../mongoose.c $(CLFLAGS) $(LFLAGS)
$(CL) post.c ../mongoose.c $(CLFLAGS) $(LFLAGS)
$(CL) post.c ../mongoose.c $(CLFLAGS) $(LFLAGS)
$(CL) /DUSE_WEBSOCKET websocket.c ../mongoose.c $(CLFLAGS) $(LFLAGS)
#$(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 15:00:04 +01:00
clean:
2013-08-16 11:17:15 +01:00
rm -rf hello upload post websocket chat *.exe *.dSYM *.obj .*o