Skip to content

Commit

Permalink
Merge pull request #36 from opencompl/christos/run-script-improv
Browse files Browse the repository at this point in the history
Separate and allow skipping of clean step in run script
  • Loading branch information
compor authored Oct 20, 2023
2 parents 02e5bfe + ff8681d commit ff482d9
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions scripts/run.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
#!/usr/bin/env bash

VALID_ARGS=$(getopt -o h --long skip-build,skip-run,skip-results,help -- "$@")
VALID_ARGS=$(getopt -o h --long skip-clean,skip-build,skip-run,skip-results,help -- "$@")
if [[ $? -ne 0 ]]; then
exit 1;
fi

SKIP_CLEAN=0
SKIP_BUILD=0
SKIP_RUN=0
SKIP_RESULTS=0

eval set -- "$VALID_ARGS"
while [ : ]; do
case "$1" in
--skip-clean)
SKIP_CLEAN=1
shift
;;
--skip-build)
SKIP_BUILD=1
shift
Expand All @@ -28,6 +33,7 @@ while [ : ]; do
;;
-h | --help)
echo ""
echo "--skip-clean Skip the clean step of build directories."
echo "--skip-build Skip the build step."
echo "--skip-run Skip the run step."
echo "--skip-results Skip the results step."
Expand Down Expand Up @@ -61,6 +67,16 @@ KERNEL_DIRS=(
"ssum/14x26xf32/"
)

# Clean step

if [[ 0 -eq ${SKIP_CLEAN} ]]; then
make VENV_DIR=${VENV_DIR} -C ${XDSL_DIR} clean

for krnl in ${KERNEL_DIRS[@]}; do
make -C ${KERNEL_ROOT}/${krnl} -j $(nproc) clean
done
fi

# Setup/build step

if [[ 0 -eq ${SKIP_BUILD} ]]; then
Expand All @@ -71,15 +87,13 @@ if [[ 0 -eq ${SKIP_BUILD} ]]; then
pip install -r ${SCRIPTS_DIR}/requirements.txt
deactivate

make VENV_DIR=${VENV_DIR} -C ${XDSL_DIR} clean
make VENV_DIR=${VENV_DIR} -C ${XDSL_DIR} venv

. ${XDSL_DIR}/${VENV_DIR}/bin/activate

[ ! -x $(which xdsl-opt) ] && echo "xdsl-opt is not found in PATH" && exit 1

for krnl in ${KERNEL_DIRS[@]}; do
make -C ${KERNEL_ROOT}/${krnl} -j $(nproc) clean
make -C ${KERNEL_ROOT}/${krnl} -j $(nproc) all
done
fi
Expand Down

0 comments on commit ff482d9

Please sign in to comment.