From 30522a5b68eccfb225379de1fb04a4b2ee3611a2 Mon Sep 17 00:00:00 2001 From: Mitya Selivanov Date: Sat, 13 Jan 2024 02:45:20 +0100 Subject: Update build script --- build_and_test.sh | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'build_and_test.sh') 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 -- cgit v1.2.3