Statistics
| Branch: | Tag: | Revision:

mongoose / examples / examples.mk @ eaef5bd1

History | View | Annotate | Download (886 Bytes)

1
SOURCES = $(PROG).c ../../mongoose.c
2
CFLAGS = -g -W -Wall -Werror -I../.. -Wno-unused-function $(CFLAGS_EXTRA) $(MODULE_CFLAGS)
3

    
4
all: $(PROG)
5

    
6
ifeq ($(OS), Windows_NT)
7
# TODO(alashkin): enable SSL in Windows
8
CFLAGS += -lws2_32
9
CC = gcc
10
else
11
CFLAGS += -pthread
12
endif
13

    
14
ifeq ($(SSL_LIB),openssl)
15
CFLAGS += -DMG_ENABLE_SSL -lssl -lcrypto
16
endif
17
ifeq ($(SSL_LIB), krypton)
18
CFLAGS += -DMG_ENABLE_SSL ../../../krypton/krypton.c -I../../../krypton
19
endif
20
ifeq ($(SSL_LIB),mbedtls)
21
CFLAGS += -DMG_ENABLE_SSL -DMG_SSL_IF=MG_SSL_IF_MBEDTLS -DMG_SSL_MBED_DUMMY_RANDOM -lmbedcrypto -lmbedtls -lmbedx509
22
endif
23

    
24
ifeq ($(JS), yes)
25
	V7_PATH = ../../deps/v7
26
	CFLAGS_EXTRA += -DMG_ENABLE_JAVASCRIPT -I $(V7_PATH) $(V7_PATH)/v7.c
27
endif
28

    
29
$(PROG): $(SOURCES)
30
	$(CC) $(SOURCES) -o $@ $(CFLAGS)
31

    
32
$(PROG).exe: $(SOURCES)
33
	cl $(SOURCES) /I../.. /MD /Fe$@
34

    
35
clean:
36
	rm -rf *.gc* *.dSYM *.exe *.obj *.o a.out $(PROG)