Skip to content

Commit bc692d7

Browse files
committed
Add flag to cleanup build artifacts (build.sh)
1 parent 2159610 commit bc692d7

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

build.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
# USAGE
1111
# build.sh [--compiler {intel|gnu|<other>}] [--cflags '<custom compiler flags here>']
1212
# [--coverage [{yes|no}]] [--profile [{yes|no}]] [--skip-tests [{yes|no}]]
13-
# [--skip-documentation [{yes|no}]] [--enable-unicode [{yes|no}]] [--help]"
13+
# [--skip-documentation [{yes|no}]] [--enable-unicode [{yes|no}]] [--help]
14+
# [--clean]
1415
#
1516
# By default, if invoked without any flags, this build script will build the
1617
# json-fortran library using gfortran,
@@ -32,6 +33,9 @@
3233
#
3334
# --help : Print a usage message and exit.
3435
#
36+
# --clean : Delete generated files and clean up after builds
37+
#
38+
#
3539
# The following flags all (optionally) accept an argument, "yes" or "no." If
3640
# no argument is passed, "yes" will be assumed.
3741
#
@@ -221,6 +225,9 @@ while [ "$#" -ge "1" ]; do # Get command line arguments while there are more lef
221225
print_usage
222226
exit 0
223227
;;
228+
--clean)
229+
rm -r src{,/tests}/*.o $DOCDIR* $LIBDIR* $BINDIR* *.gcov*
230+
;;
224231
*)
225232
echo "Unknown flag, \"$1\", passed to ${script_name}!" 2>&1
226233
print_usage

0 commit comments

Comments
 (0)