|
|
|
@ -2,7 +2,7 @@
@@ -2,7 +2,7 @@
|
|
|
|
|
|
|
|
|
|
set -e |
|
|
|
|
|
|
|
|
|
TPUT=$(which tput 2>/dev/null || echo true) |
|
|
|
|
TPUT=$(command -v tput 2>/dev/null || echo true) |
|
|
|
|
|
|
|
|
|
DIR=$(cd "$(dirname "$0")"; pwd -P) |
|
|
|
|
|
|
|
|
@ -11,7 +11,7 @@ TOOLCHAIN_IMAGE="esp32-toolchain:latest"
@@ -11,7 +11,7 @@ TOOLCHAIN_IMAGE="esp32-toolchain:latest"
|
|
|
|
|
DOCKERFILE="$DIR/Dockerfile" |
|
|
|
|
|
|
|
|
|
echo_status() { |
|
|
|
|
echo "$($TPUT setaf 2)==> $@$($TPUT sgr0)" |
|
|
|
|
echo "$($TPUT setaf 2)==> $*$($TPUT sgr0)" |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
get_docker_run_flags() { |
|
|
|
@ -23,7 +23,7 @@ get_docker_run_flags() {
@@ -23,7 +23,7 @@ get_docker_run_flags() {
|
|
|
|
|
fi |
|
|
|
|
USB_SERIAL_DEVICES=$(find /dev -name 'ttyUSB0' -o -name 'ttyACM*') |
|
|
|
|
for device in $USB_SERIAL_DEVICES; do |
|
|
|
|
DOCKER_RUN_FLAGS+=(--device $device) |
|
|
|
|
DOCKER_RUN_FLAGS+=(--device "$device") |
|
|
|
|
echo_status "Adding device $device to container" |
|
|
|
|
done |
|
|
|
|
fi |
|
|
|
@ -38,7 +38,7 @@ build_docker_container() {
@@ -38,7 +38,7 @@ build_docker_container() {
|
|
|
|
|
build_docker() { |
|
|
|
|
build_docker_container |
|
|
|
|
get_docker_run_flags |
|
|
|
|
local targets="$@" |
|
|
|
|
local targets=$* |
|
|
|
|
if [ -z "$targets" ]; then |
|
|
|
|
targets="all" |
|
|
|
|
fi |
|
|
|
@ -55,7 +55,7 @@ build_cmake() {
@@ -55,7 +55,7 @@ build_cmake() {
|
|
|
|
|
cd "$BUILD_DIR" |
|
|
|
|
echo_status "CMake configure" |
|
|
|
|
cmake -G Ninja "$DIR" |
|
|
|
|
echo_status "CMake build $@" |
|
|
|
|
echo_status "CMake build $*" |
|
|
|
|
cmake --build "$BUILD_DIR" -- "$@" |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|