# HG changeset patch # User Mychaela Falconia # Date 1532363930 0 # Node ID 5ba0bee90efa2247e56f52e9adfd16cfaf240648 # Parent 5c4db73d289a6f2bafed1d791d42fe61ef40e24b build system: new configuration naming mechanism diff -r 5c4db73d289a -r 5ba0bee90efa configure-gcc.sh --- a/configure-gcc.sh Mon Jul 23 07:01:39 2018 +0000 +++ b/configure-gcc.sh Mon Jul 23 16:38:50 2018 +0000 @@ -52,8 +52,6 @@ . "targets/$TARGET.conf" -BUILD_DIR="build-$TARGET-gcc" - # settings derived from the target-defined DSP version case "$DSP" in @@ -90,6 +88,8 @@ SERIAL_DYNAMIC_SWITCH=0 TR_BAUD_CONFIG=TR_BAUD_115200 +SUFFIX= + # allow the user to override these defaults shift @@ -99,6 +99,48 @@ shift done +# validate key settings and build configuration name + +case "$SRVC" in + 0) + CONFIG_NAME=vo + ;; + 1) + CONFIG_NAME=fd + ;; + 2) + CONFIG_NAME=da + ;; + *) + echo "Error: SRVC=$SRVC setting is invalid" 1>&2 + exit 1 +esac + +case "$GPRS" in + 0) + ;; + 1) + CONFIG_NAME=gprs + ;; + *) + echo "Error: GPRS=$GPRS setting is invalid" 1>&2 + exit 1 +esac + +case "$FCHG_STATE" in + 0) + ;; + 1) + CONFIG_NAME="$CONFIG_NAME-chg" + ;; + *) + echo "Error: FCHG_STATE=$FCHG_STATE setting is invalid" 1>&2 + exit 1 +esac + +CONFIG_NAME="$CONFIG_NAME$SUFFIX-gcc" +BUILD_DIR="build-$TARGET-$CONFIG_NAME" + echo "Building firmware for target $TARGET in $BUILD_DIR" if [ "$clean_flag" = 1 ] @@ -264,7 +306,9 @@ # generate the top level Makefile! -helpers/makeline def TARGET $TARGET > $BUILD_DIR/Makefile +helpers/makeline def CONFIG_NAME $CONFIG_NAME > $BUILD_DIR/Makefile +echo >> $BUILD_DIR/Makefile +helpers/makeline def TARGET $TARGET >> $BUILD_DIR/Makefile echo >> $BUILD_DIR/Makefile helpers/makeline def SUBDIR $SUBDIR >> $BUILD_DIR/Makefile echo >> $BUILD_DIR/Makefile diff -r 5c4db73d289a -r 5ba0bee90efa configure-tms470.sh --- a/configure-tms470.sh Mon Jul 23 07:01:39 2018 +0000 +++ b/configure-tms470.sh Mon Jul 23 16:38:50 2018 +0000 @@ -47,8 +47,6 @@ . "targets/$TARGET.conf" -BUILD_DIR="build-$TARGET-tms470" - # settings derived from the target-defined DSP version case "$DSP" in @@ -85,6 +83,8 @@ SERIAL_DYNAMIC_SWITCH=0 TR_BAUD_CONFIG=TR_BAUD_115200 +SUFFIX= + # allow the user to override these defaults shift @@ -94,6 +94,48 @@ shift done +# validate key settings and build configuration name + +case "$SRVC" in + 0) + CONFIG_NAME=vo + ;; + 1) + CONFIG_NAME=fd + ;; + 2) + CONFIG_NAME=da + ;; + *) + echo "Error: SRVC=$SRVC setting is invalid" 1>&2 + exit 1 +esac + +case "$GPRS" in + 0) + ;; + 1) + CONFIG_NAME=gprs + ;; + *) + echo "Error: GPRS=$GPRS setting is invalid" 1>&2 + exit 1 +esac + +case "$FCHG_STATE" in + 0) + ;; + 1) + CONFIG_NAME="$CONFIG_NAME-chg" + ;; + *) + echo "Error: FCHG_STATE=$FCHG_STATE setting is invalid" 1>&2 + exit 1 +esac + +CONFIG_NAME="$CONFIG_NAME$SUFFIX-470" +BUILD_DIR="build-$TARGET-$CONFIG_NAME" + echo "Building firmware for target $TARGET in $BUILD_DIR" if [ "$clean_flag" = 1 ] @@ -305,7 +347,9 @@ # generate the top level Makefile! -helpers/makeline def SUBDIR $SUBDIR > $BUILD_DIR/Makefile +helpers/makeline def CONFIG_NAME $CONFIG_NAME > $BUILD_DIR/Makefile +echo >> $BUILD_DIR/Makefile +helpers/makeline def SUBDIR $SUBDIR >> $BUILD_DIR/Makefile echo >> $BUILD_DIR/Makefile helpers/makeline def LIBS $LIBS >> $BUILD_DIR/Makefile echo >> $BUILD_DIR/Makefile diff -r 5c4db73d289a -r 5ba0bee90efa gcc/makefile-body --- a/gcc/makefile-body Mon Jul 23 07:01:39 2018 +0000 +++ b/gcc/makefile-body Mon Jul 23 16:38:50 2018 +0000 @@ -27,7 +27,7 @@ ${CC} -c ${CFLAGS} $< build_date.c: ${LIBS} bootentry-flash.o bootentry-xram.o ramvecs.o Makefile - ../helpers/build-date gcc > $@ + ../helpers/build-date ${CONFIG_NAME} > $@ build_date.o: build_date.c ${CC} -c ${CFLAGS} build_date.c diff -r 5c4db73d289a -r 5ba0bee90efa tms470/makefile-frags/link-steps --- a/tms470/makefile-frags/link-steps Mon Jul 23 07:01:39 2018 +0000 +++ b/tms470/makefile-frags/link-steps Mon Jul 23 16:38:50 2018 +0000 @@ -1,5 +1,5 @@ build_date.c: ${LIBS} - ../helpers/build-date TMS470 > $@ + ../helpers/build-date ${CONFIG_NAME} > $@ build_date.obj: build_date.c ../tms470/toolwrap/cl470 -q -c -me -mt -o -pw2 -x -mw build_date.c