summaryrefslogtreecommitdiff
path: root/build_and_test.sh
diff options
context:
space:
mode:
authorMitya Selivanov <automainint@guattari.tech>2024-01-13 02:45:20 +0100
committerMitya Selivanov <automainint@guattari.tech>2024-01-13 02:45:20 +0100
commit30522a5b68eccfb225379de1fb04a4b2ee3611a2 (patch)
treecd6b0c5264c9847df2ba8db12d598c8376955e4a /build_and_test.sh
parent003a33d7088d58a4a6a5aa0946328b3b092b8dd5 (diff)
downloadsaw-30522a5b68eccfb225379de1fb04a4b2ee3611a2.zip
Update build script
Diffstat (limited to 'build_and_test.sh')
-rwxr-xr-xbuild_and_test.sh17
1 files changed, 15 insertions, 2 deletions
diff --git a/build_and_test.sh b/build_and_test.sh
index b2a72d0..517ae4a 100755
--- a/build_and_test.sh
+++ b/build_and_test.sh
@@ -5,6 +5,8 @@ USE_COMPILER=
DESTINATION=
EXTRA_OPTIONS=
EXTRA_LINK_OPTIONS=
+SKIP_TESTS=0
+REBUILD=0
while [ $# -gt 0 ]; do
case $1 in
@@ -19,6 +21,8 @@ while [ $# -gt 0 ]; do
echo " -d --destination - Set destination path"
echo " -o --options - Set additional options for the compiler"
echo " -l --link - Set additional options for the linker"
+ echo " -S --skip-tests - Skip tests"
+ echo " -R --rebuild - Rebuild the whole project"
echo ""
exit 0
;;
@@ -47,6 +51,14 @@ while [ $# -gt 0 ]; do
shift
shift
;;
+ -S|--skip-tests)
+ SKIP_TESTS=1
+ shift
+ ;;
+ -R|--rebuild)
+ REBUILD=1
+ shift
+ ;;
*)
echo "Unknown option $1"
shift
@@ -198,7 +210,8 @@ echo "Compiler options: $FLAGS"
echo "Link options: $LINK_FLAGS"
echo ""
-if [ ! -f "$FOLDER/_dep${OBJ_POSTFIX}" ] || \
+if [ $REBUILD -ne 0 ] || \
+ [ ! -f "$FOLDER/_dep${OBJ_POSTFIX}" ] || \
[ "source/saw/_dep.c" -nt "$FOLDER/_dep${OBJ_POSTFIX}" ]; then
echo "Rebuild dependencies"
$COMPILE ${FLAGS} \
@@ -219,7 +232,7 @@ if [ $? -ne 0 ]; then
exit 1
fi
-if [ "$COMPILE" = "emcc" ]; then
+if [ $SKIP_TESTS -ne 0 ] || [ "$COMPILE" = "emcc" ]; then
exit 0
fi