2014-02-06 10:18:30 +00:00
|
|
|
CFLAGS = -W -Wall -I.. -pthread -g -pipe $(CFLAGS_EXTRA)
|
|
|
|
RM = rm -rf
|
|
|
|
MSVC = ../../vc6
|
|
|
|
CL = $(MSVC)/bin/cl
|
|
|
|
CLFLAGS = /MD /TC /nologo $(CFLAGS_EXTRA) /W3 \
|
|
|
|
/I$(MSVC)/include /I.. /Dsnprintf=_snprintf
|
|
|
|
LFLAGS = /link /incremental:no /libpath:$(MSVC)/lib /machine:IX86
|
|
|
|
|
2010-05-03 21:46:42 +01:00
|
|
|
|
2013-08-16 11:17:15 +01:00
|
|
|
ifeq ($(OS),Windows_NT)
|
2014-01-11 16:18:29 +00:00
|
|
|
RM = del /q /f
|
2014-02-06 10:18:30 +00:00
|
|
|
CC = $(MSVC)/bin/cl $(CLFLAGS)
|
2013-08-16 11:17:15 +01:00
|
|
|
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
|
|
|
|
|
2014-02-07 13:03:11 +00:00
|
|
|
# To enable Lua in a server, uncomment following lines
|
|
|
|
LUA = ../lua-5.2.3/src
|
|
|
|
#CFLAGS += -I$(LUA) -L$(LUA) -llua
|
|
|
|
|
2014-01-17 10:17:15 +00:00
|
|
|
all: websocket_html.c
|
2013-12-16 13:33:50 +00:00
|
|
|
$(CC) hello.c ../mongoose.c -o hello $(CFLAGS)
|
2014-01-17 10:17:15 +00:00
|
|
|
$(CC) websocket.c websocket_html.c ../mongoose.c -o websocket $(CFLAGS)
|
2013-12-23 08:06:35 +00:00
|
|
|
$(CC) post.c ../mongoose.c -o post $(CFLAGS)
|
2013-12-26 10:13:04 +00:00
|
|
|
$(CC) multi_threaded.c ../mongoose.c -o multi_threaded $(CFLAGS)
|
2014-01-13 17:01:11 +00:00
|
|
|
$(CC) upload.c ../mongoose.c -o upload $(CFLAGS)
|
2014-01-13 17:58:14 +00:00
|
|
|
$(CC) auth.c ../mongoose.c -o auth $(CFLAGS)
|
2014-01-16 13:53:18 +00:00
|
|
|
$(CC) server.c ../mongoose.c -o server $(CFLAGS)
|
2013-12-16 13:33:50 +00:00
|
|
|
|
2014-01-17 10:17:15 +00:00
|
|
|
websocket_html.c: websocket.html
|
|
|
|
perl mkdata.pl $< > $@
|
2013-08-16 11:17:15 +01:00
|
|
|
|
2014-01-17 10:17:15 +00:00
|
|
|
windows: websocket_html.c
|
2013-08-16 11:17:15 +01:00
|
|
|
$(CL) hello.c ../mongoose.c $(CLFLAGS) $(LFLAGS)
|
2014-01-17 10:17:15 +00:00
|
|
|
$(CL) websocket.c websocket_html.c ../mongoose.c $(CLFLAGS) $(LFLAGS)
|
2013-12-23 08:09:59 +00:00
|
|
|
$(CL) post.c ../mongoose.c $(CLFLAGS) $(LFLAGS)
|
2013-12-26 10:13:04 +00:00
|
|
|
$(CL) multi_threaded.c ../mongoose.c $(CLFLAGS) $(LFLAGS)
|
2014-01-13 17:01:11 +00:00
|
|
|
$(CL) upload.c ../mongoose.c $(CLFLAGS) $(LFLAGS)
|
2014-01-13 17:58:14 +00:00
|
|
|
$(CL) auth.c ../mongoose.c $(CLFLAGS) $(LFLAGS)
|
2014-01-16 13:53:18 +00:00
|
|
|
$(CL) server.c ../mongoose.c $(CLFLAGS) $(LFLAGS)
|
2014-01-13 17:01:11 +00:00
|
|
|
|
2012-10-14 15:00:04 +01:00
|
|
|
clean:
|
2014-02-07 13:03:11 +00:00
|
|
|
-@$(RM) hello upload post websocket auth server *.exe *.dSYM *.obj .*o
|