Skip to content
Snippets Groups Projects
Commit e0aceb4f authored by Sergey Lyubka's avatar Sergey Lyubka
Browse files

Fixed windows build for examples

parent ea9a60a5
No related branches found
No related tags found
No related merge requests found
CFLAGS = -W -Wall -I.. -pthread -g -pipe $(CFLAGS_EXTRA) CFLAGS = -W -Wall -I.. -pthread -g -pipe $(CFLAGS_EXTRA)
RM = rm -rf RM = rm -rf
OUT = -o $@
ifeq ($(OS),Windows_NT) ifeq ($(OS),Windows_NT)
MSVC = ../../vc6 MSVC = ../../vc6
RM = del /q /f RM = del /q /f
CC = $(MSVC)/bin/cl $(CLFLAGS) OUT =
CLFLAGS = /MD /TC /nologo $(CFLAGS_EXTRA) /W3 \ CC = $(MSVC)/bin/cl
/I$(MSVC)/include /I.. /Dsnprintf=_snprintf CFLAGS = /MD /TC /nologo /W3 /I$(MSVC)/include /I..
LFLAGS = /link /incremental:no /libpath:$(MSVC)/lib /machine:IX86 CFLAGS += /link /incremental:no /libpath:$(MSVC)/lib /machine:IX86
CFLAGS += $(CFLAGS_EXTRA)
else else
UNAME_S := $(shell uname -s) UNAME_S := $(shell uname -s)
...@@ -25,42 +27,32 @@ all: hello websocket server post multi_threaded upload auth ...@@ -25,42 +27,32 @@ all: hello websocket server post multi_threaded upload auth
LUA = ../lua-5.2.3/src LUA = ../lua-5.2.3/src
#CFLAGS += -I$(LUA) -L$(LUA) -llua #CFLAGS += -I$(LUA) -L$(LUA) -llua
server: server.c ../mongoose.c
$(CC) server.c ../mongoose.c $(OUT) $(CFLAGS)
hello: hello.c ../mongoose.c hello: hello.c ../mongoose.c
$(CC) hello.c ../mongoose.c -o hello $(CFLAGS) $(CC) hello.c ../mongoose.c $(OUT) $(CFLAGS)
websocket: websocket_html.c websocket.c ../mongoose.c websocket: websocket_html.c websocket.c ../mongoose.c
$(CC) websocket.c websocket_html.c ../mongoose.c -o websocket $(CFLAGS) $(CC) websocket.c websocket_html.c ../mongoose.c $(OUT) $(CFLAGS)
server: server.c ../mongoose.c
$(CC) server.c ../mongoose.c -o server $(CFLAGS)
post: post.c ../mongoose.c post: post.c ../mongoose.c
$(CC) post.c ../mongoose.c -o post $(CFLAGS) $(CC) post.c ../mongoose.c $(OUT) $(CFLAGS)
multi_threaded: multi_threaded.c ../mongoose.c multi_threaded: multi_threaded.c ../mongoose.c
$(CC) multi_threaded.c ../mongoose.c -o multi_threaded $(CFLAGS) $(CC) multi_threaded.c ../mongoose.c $(OUT) $(CFLAGS)
upload: upload.c ../mongoose.c upload: upload.c ../mongoose.c
$(CC) upload.c ../mongoose.c -o upload $(CFLAGS) $(CC) upload.c ../mongoose.c $(OUT) $(CFLAGS)
auth: auth.c ../mongoose.c auth: auth.c ../mongoose.c
$(CC) auth.c ../mongoose.c -o auth $(CFLAGS) $(CC) auth.c ../mongoose.c $(OUT) $(CFLAGS)
websocket_html.c: websocket.html websocket_html.c: websocket.html
perl mkdata.pl $< > $@ perl mkdata.pl $< > $@
windows: websocket_html.c
$(CL) hello.c ../mongoose.c $(CLFLAGS) $(LFLAGS)
$(CL) websocket.c websocket_html.c ../mongoose.c $(CLFLAGS) $(LFLAGS)
$(CL) post.c ../mongoose.c $(CLFLAGS) $(LFLAGS)
$(CL) multi_threaded.c ../mongoose.c $(CLFLAGS) $(LFLAGS)
$(CL) upload.c ../mongoose.c $(CLFLAGS) $(LFLAGS)
$(CL) auth.c ../mongoose.c $(CLFLAGS) $(LFLAGS)
$(CL) server.c ../mongoose.c $(CLFLAGS) $(LFLAGS)
u: u:
g++ unit_test.c -Wall -W -pedantic -lssl -g -O0 && ./a.out g++ unit_test.c -Wall -W -pedantic -lssl -g -O0 && ./a.out
clean: clean:
-@$(RM) hello upload post websocket auth server *.exe *.dSYM *.obj .*o -@$(RM) hello upload post websocket auth server *.exe *.dSYM *.obj .*o
...@@ -2,6 +2,10 @@ ...@@ -2,6 +2,10 @@
#include <time.h> #include <time.h>
#include "mongoose.h" #include "mongoose.h"
#ifdef _WIN32
#define snprintf _snprintf
#endif
extern const char *find_embedded_file(const char *, size_t *); extern const char *find_embedded_file(const char *, size_t *);
static int iterate_callback(struct mg_connection *c, enum mg_event ev) { static int iterate_callback(struct mg_connection *c, enum mg_event ev) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment