Skip to content

Commit

Permalink
build.sh: improve script
Browse files Browse the repository at this point in the history
Signed-off-by: Álvaro Fernández Rojas <[email protected]>
  • Loading branch information
Noltari committed May 3, 2022
1 parent 982b071 commit 71faf30
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
#!/bin/sh
#!/bin/bash

BUILD_DIR=build
PICO_SDK_DIR=pico-sdk

main () {
local cur_dir=$PWD
BASE_DIR="$(dirname ${BASH_SOURCE[0]})"
BUILD_DIR=$BASE_DIR/build
PICO_SDK_DIR=$BASE_DIR/pico-sdk

main() {
if [ ! -d "$PICO_SDK_DIR/.git" ]; then
git submodule sync --recursive
git submodule update --init --recursive
fi

mkdir -p $BUILD_DIR
cd $BUILD_DIR
cmake ../
make

cd $cur_dir
cmake -B $BUILD_DIR -S $BASE_DIR
make -C $BUILD_DIR
}

main $@

0 comments on commit 71faf30

Please sign in to comment.