2020-04-02 19:10:02 -04:00
|
|
|
#!/usr/bin/env bash
|
2022-01-05 22:17:29 -05:00
|
|
|
|
2022-01-06 02:09:48 -05:00
|
|
|
set -euo pipefail
|
|
|
|
PARAM=""
|
|
|
|
|
2022-01-05 22:17:29 -05:00
|
|
|
# Retrive the target from the current filename, if no target specified,
|
|
|
|
# the variable will be empty
|
|
|
|
TARGET=$(echo $0 | cut -s -f2 -d- | cut -s -f1 -d.)
|
|
|
|
if [[ -n $TARGET ]]
|
|
|
|
then
|
|
|
|
# Target is not null, specify the build parameters
|
|
|
|
PARAM="-DCMAKE_TOOLCHAIN_FILE=$IDF_PATH/tools/cmake/toolchain-${TARGET}.cmake -DTARGET=${TARGET} -GNinja"
|
|
|
|
fi
|
|
|
|
|
2019-03-23 22:14:49 -04:00
|
|
|
rm -rf build && mkdir build && cd build
|
2022-01-05 22:17:29 -05:00
|
|
|
cmake .. $PARAM
|
2020-04-02 19:10:02 -04:00
|
|
|
cmake --build .
|