mirror of
https://github.com/cesanta/mongoose.git
synced 2025-01-18 23:53:15 +08:00
Fixed windows build for examples
This commit is contained in:
parent
ea9a60a59a
commit
e0aceb4f3a
@ -1,13 +1,15 @@
|
||||
CFLAGS = -W -Wall -I.. -pthread -g -pipe $(CFLAGS_EXTRA)
|
||||
RM = rm -rf
|
||||
CFLAGS = -W -Wall -I.. -pthread -g -pipe $(CFLAGS_EXTRA)
|
||||
RM = rm -rf
|
||||
OUT = -o $@
|
||||
|
||||
ifeq ($(OS),Windows_NT)
|
||||
MSVC = ../../vc6
|
||||
MSVC = ../../vc6
|
||||
RM = del /q /f
|
||||
CC = $(MSVC)/bin/cl $(CLFLAGS)
|
||||
CLFLAGS = /MD /TC /nologo $(CFLAGS_EXTRA) /W3 \
|
||||
/I$(MSVC)/include /I.. /Dsnprintf=_snprintf
|
||||
LFLAGS = /link /incremental:no /libpath:$(MSVC)/lib /machine:IX86
|
||||
OUT =
|
||||
CC = $(MSVC)/bin/cl
|
||||
CFLAGS = /MD /TC /nologo /W3 /I$(MSVC)/include /I..
|
||||
CFLAGS += /link /incremental:no /libpath:$(MSVC)/lib /machine:IX86
|
||||
CFLAGS += $(CFLAGS_EXTRA)
|
||||
else
|
||||
UNAME_S := $(shell uname -s)
|
||||
|
||||
@ -25,42 +27,32 @@ all: hello websocket server post multi_threaded upload auth
|
||||
LUA = ../lua-5.2.3/src
|
||||
#CFLAGS += -I$(LUA) -L$(LUA) -llua
|
||||
|
||||
server: server.c ../mongoose.c
|
||||
$(CC) server.c ../mongoose.c $(OUT) $(CFLAGS)
|
||||
|
||||
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
|
||||
$(CC) websocket.c websocket_html.c ../mongoose.c -o websocket $(CFLAGS)
|
||||
|
||||
server: server.c ../mongoose.c
|
||||
$(CC) server.c ../mongoose.c -o server $(CFLAGS)
|
||||
$(CC) websocket.c websocket_html.c ../mongoose.c $(OUT) $(CFLAGS)
|
||||
|
||||
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
|
||||
$(CC) multi_threaded.c ../mongoose.c -o multi_threaded $(CFLAGS)
|
||||
$(CC) multi_threaded.c ../mongoose.c $(OUT) $(CFLAGS)
|
||||
|
||||
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
|
||||
$(CC) auth.c ../mongoose.c -o auth $(CFLAGS)
|
||||
$(CC) auth.c ../mongoose.c $(OUT) $(CFLAGS)
|
||||
|
||||
websocket_html.c: websocket.html
|
||||
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:
|
||||
g++ unit_test.c -Wall -W -pedantic -lssl -g -O0 && ./a.out
|
||||
|
||||
|
||||
clean:
|
||||
-@$(RM) hello upload post websocket auth server *.exe *.dSYM *.obj .*o
|
||||
|
@ -2,6 +2,10 @@
|
||||
#include <time.h>
|
||||
#include "mongoose.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#define snprintf _snprintf
|
||||
#endif
|
||||
|
||||
extern const char *find_embedded_file(const char *, size_t *);
|
||||
|
||||
static int iterate_callback(struct mg_connection *c, enum mg_event ev) {
|
||||
|
Loading…
Reference in New Issue
Block a user