2017-02-06 15:55:32 +02:00
|
|
|
SOURCES = $(PROG).c ../../mongoose.c
|
|
|
|
CFLAGS = -g -W -Wall -Werror -I../.. -Wno-unused-function $(CFLAGS_EXTRA) $(MODULE_CFLAGS)
|
|
|
|
|
|
|
|
all: $(PROG)
|
|
|
|
|
|
|
|
ifeq ($(OS), Windows_NT)
|
|
|
|
# TODO(alashkin): enable SSL in Windows
|
|
|
|
CFLAGS += -lws2_32
|
|
|
|
CC = gcc
|
|
|
|
else
|
|
|
|
CFLAGS += -pthread
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(SSL_LIB),openssl)
|
|
|
|
CFLAGS += -DMG_ENABLE_SSL -lssl -lcrypto
|
|
|
|
endif
|
|
|
|
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
|
|
|
|
endif
|
|
|
|
|
2017-10-30 17:49:41 +03:00
|
|
|
ifdef ASAN
|
|
|
|
CC = clang
|
|
|
|
CFLAGS += -fsanitize=address
|
|
|
|
endif
|
|
|
|
|
2017-02-06 15:55:32 +02: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)
|