2017-11-11 17:18:59 -08:00
|
|
|
COMPONENT_DEPENDS := mbedtls openssl
|
|
|
|
#COMPONENT_ADD_INCLUDEDIRS := ../../../../../../../../../../../../../../../../../../../../$(COMPONENT_BUILD_DIR)/include
|
2017-02-18 17:26:40 +08:00
|
|
|
|
2017-11-11 17:18:59 -08:00
|
|
|
COMPONENT_OWNBUILDTARGET := 1
|
2017-02-18 17:26:40 +08:00
|
|
|
|
2017-11-11 17:18:59 -08:00
|
|
|
CROSS_PATH1 := $(shell which xtensa-esp32-elf-gcc )
|
|
|
|
CROSS_PATH := $(shell dirname $(CROSS_PATH1) )/..
|
|
|
|
|
|
|
|
# detect MSYS2 environment and set generator flag if found
|
|
|
|
# also set executable extension to .exe so that tools can be properly found
|
|
|
|
# and disable bundled zlib
|
|
|
|
MSYS_VERSION = $(if $(findstring Msys, $(shell uname -o)),$(word 1, $(subst ., ,$(shell uname -r))),0)
|
|
|
|
ifneq ($(MSYS_VERSION),0)
|
|
|
|
MSYS_FLAGS = -DLWS_WITH_BUNDLED_ZLIB=0 -DEXECUTABLE_EXT=.exe -G'MSYS Makefiles'
|
|
|
|
endif
|
2017-02-18 17:26:40 +08:00
|
|
|
|
2017-11-05 14:28:57 +08:00
|
|
|
# -DNDEBUG=1 after cflags stops debug etc being built
|
2017-02-18 17:26:40 +08:00
|
|
|
.PHONY: build
|
|
|
|
build:
|
|
|
|
cd $(COMPONENT_BUILD_DIR) ; \
|
|
|
|
echo "doing lws cmake" ; \
|
2017-11-26 09:22:42 +08:00
|
|
|
cmake $(COMPONENT_PATH) -DLWS_C_FLAGS="$(CFLAGS) -DNDEBUG=1" \
|
2017-03-16 10:46:31 +08:00
|
|
|
-DIDF_PATH=$(IDF_PATH) \
|
2017-02-18 17:26:40 +08:00
|
|
|
-DCROSS_PATH=$(CROSS_PATH) \
|
2017-03-10 14:29:21 +08:00
|
|
|
-DBUILD_DIR_BASE=$(BUILD_DIR_BASE) \
|
2017-09-22 09:46:58 +08:00
|
|
|
-DCMAKE_TOOLCHAIN_FILE=$(COMPONENT_PATH)/contrib/cross-esp32.cmake \
|
2017-11-26 09:22:42 +08:00
|
|
|
-DCMAKE_BUILD_TYPE=RELEASE \
|
2018-06-16 08:53:48 -07:00
|
|
|
-DLWS_MBEDTLS_INCLUDE_DIRS="${IDF_PATH}/components/openssl/include;${IDF_PATH}/components/mbedtls/mbedtls/include;${IDF_PATH}/components/mbedtls/port/include" \
|
2017-05-30 09:01:32 +08:00
|
|
|
-DLWS_WITH_STATS=0 \
|
2017-10-13 10:33:02 +08:00
|
|
|
-DLWS_WITH_HTTP2=1 \
|
2017-11-14 11:25:54 +08:00
|
|
|
-DLWS_WITH_RANGES=1 \
|
2017-11-11 17:18:59 -08:00
|
|
|
-DLWS_WITH_ACME=1 \
|
2017-11-14 11:25:54 +08:00
|
|
|
-DLWS_WITH_ZLIB=1 \
|
|
|
|
-DLWS_WITH_ZIP_FOPS=1 \
|
2017-03-16 10:46:31 +08:00
|
|
|
-DZLIB_LIBRARY=$(BUILD_DIR_BASE)/zlib/libzlib.a \
|
|
|
|
-DZLIB_INCLUDE_DIR=$(COMPONENT_PATH)/../zlib \
|
2017-11-11 17:18:59 -08:00
|
|
|
-DLWS_WITH_ESP32=1 \
|
|
|
|
$(MSYS_FLAGS) ; \
|
2017-03-16 10:46:31 +08:00
|
|
|
make && \
|
2017-02-18 17:26:40 +08:00
|
|
|
cp ${COMPONENT_BUILD_DIR}/lib/libwebsockets.a ${COMPONENT_BUILD_DIR}/liblibwebsockets.a
|
|
|
|
|
|
|
|
clean: myclean
|
|
|
|
|
|
|
|
myclean:
|
|
|
|
rm -rf ./build
|