Skip to content

Commit

Permalink
[M] update build script for clean and verbose options
Browse files Browse the repository at this point in the history
  • Loading branch information
luswdev committed Apr 22, 2023
1 parent f082ea9 commit b799227
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,34 @@
#!/bin/bash

EXT_CMD=""
CLEAN_FLAG=false

for i in "$@"; do
case $i in
-v|--verbose)
EXT_CMD="VERBOSE=1"
shift
;;
-c|--clean)
CLEAN_FLAG=true
shift
;;
-*|--*)
echo "Unknown option $i"
exit 1
;;
*)
;;
esac
done

mkdir -p build
cd build

cmake ..

make clean
make -j`nproc` $1
if [ "$CLEAN_FLAG" = true ]; then
make clean
fi

make -j`nproc` $EXT_CMD

0 comments on commit b799227

Please sign in to comment.