Makefile 1.75 KB
Newer Older
1 2 3 4 5 6 7 8
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

9

10
ifeq ($(OS),Windows_NT)
Sergey Lyubka's avatar
Sergey Lyubka committed
11
  RM = del /q /f
12
  CC = $(MSVC)/bin/cl $(CLFLAGS)
13 14 15
else
  UNAME_S := $(shell uname -s)
  DLL_FLAGS += -shared
16

17 18 19
  ifeq ($(UNAME_S),Linux)
    CFLAGS += -ldl
  endif
20

21 22 23 24 25 26
  ifeq ($(UNAME_S),Darwin)
    #  DLL_FLAGS += -bundle -undefined dynamic_lookup -dynamiclib
    DLL_FLAGS += -flat_namespace -undefined suppress -dynamiclib
  endif
endif

Sergey Lyubka's avatar
Sergey Lyubka committed
27 28 29 30
# To enable Lua in a server, uncomment following lines
LUA    = ../lua-5.2.3/src
#CFLAGS += -I$(LUA) -L$(LUA) -llua

31
all: websocket_html.c
32
	$(CC) hello.c ../mongoose.c  -o hello $(CFLAGS)
33
	$(CC) websocket.c websocket_html.c ../mongoose.c  -o websocket $(CFLAGS)
Sergey Lyubka's avatar
Sergey Lyubka committed
34
	$(CC) post.c ../mongoose.c -o post $(CFLAGS)
35
	$(CC) multi_threaded.c ../mongoose.c -o multi_threaded $(CFLAGS)
Sergey Lyubka's avatar
Sergey Lyubka committed
36
	$(CC) upload.c ../mongoose.c -o upload $(CFLAGS)
Sergey Lyubka's avatar
Sergey Lyubka committed
37
	$(CC) auth.c ../mongoose.c -o auth $(CFLAGS)
38
	$(CC) server.c ../mongoose.c -o server $(CFLAGS)
39

40 41
websocket_html.c: websocket.html
	perl mkdata.pl $< > $@
42

43
windows: websocket_html.c
44
	$(CL) hello.c ../mongoose.c $(CLFLAGS) $(LFLAGS)
45
	$(CL) websocket.c websocket_html.c ../mongoose.c $(CLFLAGS) $(LFLAGS)
46
	$(CL) post.c ../mongoose.c $(CLFLAGS) $(LFLAGS)
47
	$(CL) multi_threaded.c ../mongoose.c $(CLFLAGS) $(LFLAGS)
Sergey Lyubka's avatar
Sergey Lyubka committed
48
	$(CL) upload.c ../mongoose.c $(CLFLAGS) $(LFLAGS)
Sergey Lyubka's avatar
Sergey Lyubka committed
49
	$(CL) auth.c ../mongoose.c $(CLFLAGS) $(LFLAGS)
50
	$(CL) server.c ../mongoose.c $(CLFLAGS) $(LFLAGS)
Sergey Lyubka's avatar
Sergey Lyubka committed
51

52 53 54 55
u:
	g++ unit_test.c -Wall -W -pedantic -lssl -g -O0 && ./a.out


Sergey Lyubka's avatar
Sergey Lyubka committed
56
clean:
Sergey Lyubka's avatar
Sergey Lyubka committed
57
	-@$(RM) hello upload post websocket auth server *.exe *.dSYM *.obj .*o