#!/bin/bash here=$(dirname $(readlink -f $0)) cd $here function log { LIGHT_CYAN='\033[1;36m' NC='\033[0m' echo -e "${LIGHT_CYAN}:: $@${NC}" } log "Preparing esp-open-sdk dependencies" git submodule sync --recursive git submodule update --init --recursive log "Updating crosstool-NG to newer version for compatibility with bash 5" (cd esp-open-sdk/crosstool-NG; git checkout a4286b8c) if python --version 2>&1 | grep " 3." then log "Python 3 detected. Creating python 2 virtualenv." virtualenv2 python2-venv source python2-venv/bin/activate pip install pyserial fi log "Building esp-open-sdk" echo 'CT_DEBUG_gdb=n' >> esp-open-sdk/crosstool-config-overrides cd esp-open-sdk make STANDALONE=y