Makefile 1.55 KB
Newer Older
1 2 3
CFLAGS = -W -Wall -I.. -pthread -g -pipe $(CFLAGS_EXTRA)
RM = rm -rf
OUT = -o $@
4

5
ifeq ($(OS),Windows_NT)
6
  MSVC = ../../vc6
Sergey Lyubka's avatar
Sergey Lyubka committed
7
  RM = del /q /f
8 9 10 11 12
  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)
13 14
else
  UNAME_S := $(shell uname -s)
15

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

20 21 22 23
  ifeq ($(UNAME_S),Darwin)
  endif
endif

24 25
all: hello websocket server post multi_threaded upload auth

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

30 31 32
server: server.c ../mongoose.c
	$(CC) server.c ../mongoose.c $(OUT)  $(CFLAGS)

33
hello: hello.c ../mongoose.c
34
	$(CC) hello.c ../mongoose.c $(OUT) $(CFLAGS)
35 36

websocket: websocket_html.c websocket.c ../mongoose.c
37
	$(CC) websocket.c websocket_html.c ../mongoose.c $(OUT)  $(CFLAGS)
38 39

post: post.c ../mongoose.c
40
	$(CC) post.c ../mongoose.c $(OUT) $(CFLAGS)
41 42

multi_threaded: multi_threaded.c ../mongoose.c
43
	$(CC) multi_threaded.c ../mongoose.c $(OUT) $(CFLAGS)
44 45

upload: upload.c ../mongoose.c
46
	$(CC) upload.c ../mongoose.c $(OUT) $(CFLAGS)
47 48

auth: auth.c ../mongoose.c
49
	$(CC) auth.c ../mongoose.c $(OUT) $(CFLAGS)
50

Sergey Lyubka's avatar
Sergey Lyubka committed
51 52 53 54
mjpg: mjpg.c ../mongoose.c
	$(CC) mjpg.c ../mongoose.c $(OUT) $(CFLAGS)


55 56
websocket_html.c: websocket.html
	perl mkdata.pl $< > $@
57

58
u:
59
	g++ unit_test.c -Wall -W -pedantic -lssl -g -O0 $(CFLAGS_EXTRA) && ./a.out
60

Sergey Lyubka's avatar
Sergey Lyubka committed
61
clean:
Sergey Lyubka's avatar
Sergey Lyubka committed
62
	-@$(RM) hello mjpg upload post websocket auth server multi_threaded websocket_html.c *.exe *.dSYM *.obj .*o