From f36e342f3889bc0761bfb09bf90ea8487c80d761 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 5 Jun 2016 12:14:18 -0600 Subject: [PATCH] tools/tesbuild.sh will now build NxWM configurations --- tools/testbuild.sh | 66 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 64 insertions(+), 2 deletions(-) diff --git a/tools/testbuild.sh b/tools/testbuild.sh index 9546c92144..c9f30a178b 100755 --- a/tools/testbuild.sh +++ b/tools/testbuild.sh @@ -34,22 +34,27 @@ WD=$PWD nuttx=$WD/../nuttx +UNLINK=./unlink.sh progname=$0 host=linux wenv=cygwin sizet=uint +APPSDIR=../apps +NXWDIR=../NxWidgets unset testfile function showusage { echo "" - echo "USAGE: $progname [-w|l] [-c|n] [-s] " + echo "USAGE: $progname [-w|l] [-c|n] [-s] [-a ] [-n ] " echo " $progname -h" echo "" echo "Where:" echo " -w|l selects Windows (w) or Linux (l). Default: Linux" echo " -c|n selects Windows native (n) or Cygwin (c). Default Cygwin" echo " -s Use C++ unsigned long size_t in new operator. Default unsigned int" + echo " -a provides the relative path to the apps/ directory. Default ../apps" + echo " -n provides the relative path to the NxWidgets/ directory. Default ../NxWidgets" echo " -h will show this help test and terminate" echo " selects the list of configurations to test. No default" echo "" @@ -78,6 +83,14 @@ while [ ! -z "$1" ]; do -s ) sizet=long ;; + -a ) + shift + APPSDIR="$1" + ;; + -n ) + shift + NXWDIR="$1" + ;; -h ) showusage ;; @@ -122,6 +135,15 @@ function distclean { fi } +# Check if build is NxWM and clean + +function nxcheck { + unset nxconfig + if [ -d $NXWDIR ]; then + nxconfig=`grep CONFIG_NXWM=y $nuttx/.config` + fi +} + # Configure for the next build function configure { @@ -196,6 +218,33 @@ function configure { make olddefconfig 1>/dev/null 2>&1 } +# Build the NxWidgets libraries + +function nxbuild { + if [ -e $APPSDIR/internal ]; then + $UNLINK $APPSDIR/internal + fi + + if [ ! -z "$nxconfig" ]; then + echo " Building NxWidgets..." + echo "------------------------------------------------------------------------------------" + + cd $nuttx/$NXTOOLS || { echo "Failed to CD to $NXTOOLS"; exit 1; } + ./install.sh $nuttx/$APPSDIR nxwm 1>/dev/null + + cd $nuttx || { echo "Failed to CD to $nuttx"; exit 1; } + make -i context 1>/dev/null + + cd $nuttx/$NXWIDGETSDIR || { echo "Failed to CD to $NXWIDGETSDIR"; exit 1; } + make -i TOPDIR=$nuttx clean 1>/dev/null + make -i TOPDIR=$nuttx 1>/dev/null + + cd $nuttx/$NXWMDIR || { echo "Failed to CD to $NXWMDIR"; exit 1; } + make -i TOPDIR=$nuttx clean 1>/dev/null + make -i TOPDIR=$nuttx 1>/dev/null + fi +} + # Perform the next build function build { @@ -209,14 +258,27 @@ function build { function dotest { echo "------------------------------------------------------------------------------------" + nxcheck distclean configure + nxbuild build } # Perform the build test for each entry in the test list file -export APPSDIR=../apps +if [ ! -d $APPSDIR ]; then + export "ERROR: No directory found at $APPSDIR" + exit 1 +fi + +export APPSDIR + +if [ -d $NXWDIR ]; then + NXWIDGETSDIR=$NXWDIR/libnxwidgets + NXWMDIR=$NXWDIR/nxwm + NXTOOLS=$NXWDIR/tools +fi # Shouldn't have to do this