mirror of
https://github.com/Noltari/pico-uart-bridge.git
synced 2024-12-28 02:06:06 +00:00
build.sh: improve script
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
This commit is contained in:
parent
982b071d6c
commit
71faf3097a
17
build.sh
17
build.sh
|
@ -1,22 +1,17 @@
|
||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
|
|
||||||
BUILD_DIR=build
|
BASE_DIR="$(dirname ${BASH_SOURCE[0]})"
|
||||||
PICO_SDK_DIR=pico-sdk
|
BUILD_DIR=$BASE_DIR/build
|
||||||
|
PICO_SDK_DIR=$BASE_DIR/pico-sdk
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
local cur_dir=$PWD
|
|
||||||
|
|
||||||
if [ ! -d "$PICO_SDK_DIR/.git" ]; then
|
if [ ! -d "$PICO_SDK_DIR/.git" ]; then
|
||||||
git submodule sync --recursive
|
git submodule sync --recursive
|
||||||
git submodule update --init --recursive
|
git submodule update --init --recursive
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir -p $BUILD_DIR
|
cmake -B $BUILD_DIR -S $BASE_DIR
|
||||||
cd $BUILD_DIR
|
make -C $BUILD_DIR
|
||||||
cmake ../
|
|
||||||
make
|
|
||||||
|
|
||||||
cd $cur_dir
|
|
||||||
}
|
}
|
||||||
|
|
||||||
main $@
|
main $@
|
||||||
|
|
Loading…
Reference in a new issue