From d3428ec59328ec0275e947532f59bfff32accd64 Mon Sep 17 00:00:00 2001 From: mesheets <16882600+mesheets@users.noreply.github.com> Date: Sat, 13 Jul 2024 16:31:31 -0400 Subject: [PATCH] Setup basic variables for makelx.sh --- util/user/makelx.sh | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/util/user/makelx.sh b/util/user/makelx.sh index 8f44e70..beb1395 100644 --- a/util/user/makelx.sh +++ b/util/user/makelx.sh @@ -7,15 +7,32 @@ ### bibo - another LEGO Mindstorms OS ### -------------------------------------------------------------------------- +# Constants +MAKE_PROGRAM=make + +# Variable Initialization +SCRIPT_NAME=$(basename $0) +MAIN_PROGRAM_SOURCE=$1 +PROGRAM_NAME=$(basename ${1%.*}) +shift +ADDITIONAL_SOURCES=$* + +# Usage information echo "Makes an LX program file from source" -echo "Usage: $(basename $0)
[additional source files]..." +echo "Usage: $SCRIPT_NAME
[additional source files]..." echo "" -echo "(Placeholder only - functionality not yet implemented)" +echo "Main program source file: '$MAIN_PROGRAM_SOURCE'" + +echo "Additional source files for $PROGRAM_NAME:" +echo " - $ADDITIONAL_SOURCES" + +MAKE_COMMAND="${MAKE_PROGRAM} SOURCES='${MAIN_PROGRAM_SOURCE}' ${PROGRAM_NAME}_SRC='${ADDITIONAL_SOURCES}'" echo "" -echo "Main source file: '$1'" -echo "Additional source files for $(basename ${1%.*}):" -shift -echo " - $*" +echo "Command to execute: ${MAKE_COMMAND}" +echo "(Placeholder only - functionality not yet implemented)" +echo "" +echo "NOTE: make cannot handle spaces in file names" +echo " - https://savannah.gnu.org/bugs/?712"