Skip to content

Commit

Permalink
[New] Compile specific module - thanks @thelittlefireman
Browse files Browse the repository at this point in the history
 Changes to be committed:
	modified:   scripts/compile.sh
  • Loading branch information
alienatedsec committed Sep 23, 2023
1 parent 26009c1 commit db856f3
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion scripts/compile.sh
Expand Up @@ -39,6 +39,7 @@ compile_module()
printf "MOD_COMPILE: %s\n" "$MOD_COMPILE"
printf "MOD_INSTALL: %s\n" "$MOD_INSTALL"

echo "Compile $MOD_NAME"
cd "$MOD_DIR"

if [ ! -f $MOD_INIT ]; then
Expand Down Expand Up @@ -89,10 +90,22 @@ mkdir -p "$(get_script_dir)/../build/home"
mkdir -p "$(get_script_dir)/../build/rootfs"

SRC_DIR=$(get_script_dir)/../src
SELECTED_MODULE=$1
if [ -n ${SELECTED_MODULE} ]; then
echo "SELECTED_MODULE: $SELECTED_MODULE"
fi

for SUB_DIR in $SRC_DIR/* ; do
if [ -d ${SUB_DIR} ]; then # Will not run if no directories are available
compile_module $(normalize_path "$SUB_DIR") || exit 1
if [ -n ${SELECTED_MODULE} ]; then
if [[ $SUB_DIR == *"$SELECTED_MODULE"* ]]; then
compile_module $(normalize_path "$SUB_DIR") || exit 1
else
echo "Skip $SUB_DIR"
fi
else
compile_module $(normalize_path "$SUB_DIR") || exit 1
fi
fi
done

Expand Down

0 comments on commit db856f3

Please sign in to comment.