2015-10-02 18:25:02 +08:00
|
|
|
SOURCES = $(PROG).c ../../mongoose.c
|
2016-08-08 18:25:55 +08:00
|
|
|
CFLAGS = -g -W -Wall -Werror -I../.. -Wno-unused-function $(CFLAGS_EXTRA) $(MODULE_CFLAGS)
|
2015-10-02 18:25:02 +08:00
|
|
|
|
|
|
|
all: $(PROG)
|
|
|
|
|
2016-03-08 19:27:34 +08:00
|
|
|
ifeq ($(OS), Windows_NT)
|
|
|
|
# TODO(alashkin): enable SSL in Windows
|
2016-03-19 18:02:09 +08:00
|
|
|
CFLAGS += -lws2_32
|
2016-03-09 17:59:32 +08:00
|
|
|
CC = gcc
|
2016-03-08 19:27:34 +08:00
|
|
|
else
|
2016-11-14 05:20:15 +08:00
|
|
|
CFLAGS += -pthread
|
|
|
|
endif
|
|
|
|
|
2016-03-08 19:27:34 +08:00
|
|
|
ifeq ($(SSL_LIB),openssl)
|
|
|
|
CFLAGS += -DMG_ENABLE_SSL -lssl -lcrypto
|
|
|
|
endif
|
2016-11-14 05:20:15 +08:00
|
|
|
ifeq ($(SSL_LIB), krypton)
|
|
|
|
CFLAGS += -DMG_ENABLE_SSL ../../../krypton/krypton.c -I../../../krypton
|
|
|
|
endif
|
|
|
|
ifeq ($(SSL_LIB),mbedtls)
|
|
|
|
CFLAGS += -DMG_ENABLE_SSL -DMG_SSL_IF=MG_SSL_IF_MBEDTLS -DMG_SSL_MBED_DUMMY_RANDOM -lmbedcrypto -lmbedtls -lmbedx509
|
2016-03-08 19:27:34 +08:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(JS), yes)
|
|
|
|
V7_PATH = ../../deps/v7
|
|
|
|
CFLAGS_EXTRA += -DMG_ENABLE_JAVASCRIPT -I $(V7_PATH) $(V7_PATH)/v7.c
|
|
|
|
endif
|
|
|
|
|
2015-10-02 18:25:02 +08:00
|
|
|
$(PROG): $(SOURCES)
|
|
|
|
$(CC) $(SOURCES) -o $@ $(CFLAGS)
|
|
|
|
|
|
|
|
$(PROG).exe: $(SOURCES)
|
|
|
|
cl $(SOURCES) /I../.. /MD /Fe$@
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf *.gc* *.dSYM *.exe *.obj *.o a.out $(PROG)
|