Format all shell scripts in tools folder

Change-Id: Ieef2eb93d56c03972b4dc63a1c55aabf1fb0d169
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao
2020-01-06 00:29:59 +08:00
parent 390ebd504f
commit 3b9efc95a2
23 changed files with 1205 additions and 1213 deletions
+3 -3
View File
@@ -115,10 +115,10 @@ echo -f:
echo Informs the tool that it should use POSIX style paths like /usr/local/bin. echo Informs the tool that it should use POSIX style paths like /usr/local/bin.
echo By default, Windows style paths like C:\\Program Files are used. echo By default, Windows style paths like C:\\Program Files are used.
echo -l selects the Linux (l) host environment. The [-c^|u^|n] options echo -l selects the Linux (l) host environment. The [-c^|u^|n] options
echo select one of the Windows environments. Default: Use host setup echo select one of the Windows environments. Default: Use host setup
echo in the defconfig file echo in the defconfig file
echo [-c^|u^|n] selects the Windows host and a Windows environment: Cygwin (c), echo [-c^|u^|n] selects the Windows host and a Windows environment: Cygwin (c),
echo Ubuntu under Windows 10 (u), or Windows native (n). Default Cygwin echo Ubuntu under Windows 10 (u), or Windows native (n). Default Cygwin
echo -a ^<app-dir^>: echo -a ^<app-dir^>:
echo Informs the configuration tool where the application build echo Informs the configuration tool where the application build
echo directory. This is a relative path from the top-level NuttX echo directory. This is a relative path from the top-level NuttX
+77 -77
View File
@@ -75,52 +75,52 @@ skip=0
while [ ! -z "$1" ]; do while [ ! -z "$1" ]; do
case "$1" in case "$1" in
-a ) -a )
shift shift
appdir=$1 appdir=$1
;; ;;
-c ) -c )
host=windows host=windows
wenv=cygwin wenv=cygwin
;; ;;
-d ) -d )
debug=y debug=y
set -x set -x
;; ;;
-g ) -g )
host=windows host=windows
wenv=msys wenv=msys
;; ;;
-h ) -h )
echo "$USAGE"
exit 0
;;
-l )
host=linux
;;
-m )
host=macos
;;
-n )
host=windows
wenv=native
;;
-s )
skip=1
;;
-u )
host=windows
wenv=ubuntu
;;
*)
if [ ! -z "${boardconfig}" ]; then
echo ""
echo "<board/config> defined twice"
echo "$USAGE" echo "$USAGE"
exit 0 exit 1
;; fi
-l ) boardconfig=$1
host=linux ;;
;;
-m )
host=macos
;;
-n )
host=windows
wenv=native
;;
-s )
skip=1
;;
-u )
host=windows
wenv=ubuntu
;;
*)
if [ ! -z "${boardconfig}" ]; then
echo ""
echo "<board/config> defined twice"
echo "$USAGE"
exit 1
fi
boardconfig=$1
;;
esac esac
shift shift
done done
@@ -330,43 +330,43 @@ if [ ! -z "$host" ]; then
sed -i -e "/CONFIG_SIM_X8664_SYSTEMV/d" ${dest_config} sed -i -e "/CONFIG_SIM_X8664_SYSTEMV/d" ${dest_config}
case "$host" in case "$host" in
"linux") "linux")
echo " Select CONFIG_HOST_LINUX=y" echo " Select CONFIG_HOST_LINUX=y"
echo "CONFIG_HOST_LINUX=y" >> "${dest_config}" echo "CONFIG_HOST_LINUX=y" >> "${dest_config}"
echo "CONFIG_SIM_X8664_SYSTEMV=y" >> "${dest_config}" echo "CONFIG_SIM_X8664_SYSTEMV=y" >> "${dest_config}"
;;
"macos")
echo " Select CONFIG_HOST_MACOS=y"
echo "CONFIG_HOST_MACOS=y" >> "${dest_config}"
;;
"windows")
echo " Select CONFIG_HOST_WINDOWS=y"
echo "CONFIG_HOST_WINDOWS=y" >> "${dest_config}"
echo "CONFIG_SIM_X8664_MICROSOFT=y" >> "${dest_config}"
case "$wenv" in
"cygwin")
echo " Select CONFIG_WINDOWS_CYGWIN=y"
echo "CONFIG_WINDOWS_CYGWIN=y" >> "${dest_config}"
;; ;;
"macos") "msys")
echo " Select CONFIG_HOST_MACOS=y" echo " Select CONFIG_WINDOWS_MSYS=y"
echo "CONFIG_HOST_MACOS=y" >> "${dest_config}" echo "CONFIG_WINDOWS_MSYS=y" >> "${dest_config}"
;; ;;
"windows") "ubuntu")
echo " Select CONFIG_HOST_WINDOWS=y" echo " Select CONFIG_WINDOWS_UBUNTU=y"
echo "CONFIG_HOST_WINDOWS=y" >> "${dest_config}" echo "CONFIG_WINDOWS_UBUNTU=y" >> "${dest_config}"
echo "CONFIG_SIM_X8664_MICROSOFT=y" >> "${dest_config}" ;;
case "$wenv" in *)
"cygwin") echo " Select CONFIG_WINDOWS_NATIVE=y"
echo " Select CONFIG_WINDOWS_CYGWIN=y" echo "CONFIG_WINDOWS_NATIVE=y" >> "${dest_config}"
echo "CONFIG_WINDOWS_CYGWIN=y" >> "${dest_config}" ;;
;; esac
"msys")
echo " Select CONFIG_WINDOWS_MSYS=y"
echo "CONFIG_WINDOWS_MSYS=y" >> "${dest_config}"
;;
"ubuntu")
echo " Select CONFIG_WINDOWS_UBUNTU=y"
echo "CONFIG_WINDOWS_UBUNTU=y" >> "${dest_config}"
;;
*)
echo " Select CONFIG_WINDOWS_NATIVE=y"
echo "CONFIG_WINDOWS_NATIVE=y" >> "${dest_config}"
;;
esac
esac esac
fi fi
+2 -2
View File
@@ -96,7 +96,7 @@ goto :End
:ShowUsage :ShowUsage
echo USAGE: %0 ^<src^> ^<dest^> echo USAGE: %0 ^<src^> ^<dest^>
echo Where: echo Where:
echo ^<src^> is the source directory to be copied echo ^<src^> is the source directory to be copied
echo ^<dest^> is the destination directory to be created echo ^<dest^> is the destination directory to be created
:End :End
+20 -21
View File
@@ -52,8 +52,8 @@ dest=$2
# Verify that arguments were provided # Verify that arguments were provided
if [ -z "${src}" -o -z "${dest}" ]; then if [ -z "${src}" -o -z "${dest}" ]; then
echo "Missing src and/or dest arguments" echo "Missing src and/or dest arguments"
exit 1 exit 1
fi fi
# Check if something already exists at the destination path replace it with # Check if something already exists at the destination path replace it with
@@ -62,40 +62,39 @@ fi
# report that it does not exist. # report that it does not exist.
if [ -h "${dest}" ]; then if [ -h "${dest}" ]; then
rm -f "${dest}" rm -f "${dest}"
else else
# If the path exists and is a directory that contains the "fake link" # If the path exists and is a directory that contains the "fake link"
# mark, then treat it like a soft link (i.e., remove the directory) # mark, then treat it like a soft link (i.e., remove the directory)
if [ -d "${dest}" -a -f "${dest}/.fakelnk" ]; then if [ -d "${dest}" -a -f "${dest}/.fakelnk" ]; then
rm -rf "${dest}" rm -rf "${dest}"
else else
# Does anything exist at the destination path? # Does anything exist at the destination path?
if [ -e "${dest}" ]; then if [ -e "${dest}" ]; then
# It is something else (like a file) or directory that does # It is something else (like a file) or directory that does
# not contain the "fake link" mark # not contain the "fake link" mark
echo "${dest} already exists but is not a symbolic link" echo "${dest} already exists but is not a symbolic link"
exit 1 exit 1
fi fi
fi fi
fi fi
# Verify that a directory exists at the source path # Verify that a directory exists at the source path
if [ ! -d "${src}" ]; then if [ ! -d "${src}" ]; then
echo "No directory at ${src}" echo "No directory at ${src}"
exit 1 exit 1
fi fi
# Copy the directory # Copy the directory
cp -a "${src}" "${dest}" || \ cp -a "${src}" "${dest}" || \
{ echo "Failed to create link: $dest" ; rm -rf ${dest} ; exit 1 ; } { echo "Failed to create link: $dest" ; rm -rf ${dest} ; exit 1 ; }
touch "${dest}/.fakelnk" || \ touch "${dest}/.fakelnk" || \
{ echo "Failed to touch ${dest}/.fakelnk" ; rm -rf ${dest} ; exit 1 ; } { echo "Failed to touch ${dest}/.fakelnk" ; rm -rf ${dest} ; exit 1 ; }
+9 -9
View File
@@ -165,14 +165,14 @@ echo definitions arguments for a variety of diffent ccpaths in a variety of
echo compilation environments" echo compilation environments"
echo USAGE:%progname% [-h] ^<compiler-path^> [-val ^<^val1^>] [^<def2^> [-val ^<val2^>] [^<def3^> [-val ^<val3^>] ...]] echo USAGE:%progname% [-h] ^<compiler-path^> [-val ^<^val1^>] [^<def2^> [-val ^<val2^>] [^<def3^> [-val ^<val3^>] ...]]
echo Where:" echo Where:"
echo ^<compiler-path^> echo ^<compiler-path^>
echo The full path to your ccpath echo The full path to your ccpath
echo ^<def1^> ^<def2^> ^<def3^> ... echo ^<def1^> ^<def2^> ^<def3^> ...
echo A list of pre-preprocesser variable names to be defined. echo A list of pre-preprocesser variable names to be defined.
echo [-val ^<val1^>] [-val ^<val2^>] [-val ^<val3^>] ... echo [-val ^<val1^>] [-val ^<val2^>] [-val ^<val3^>] ...
echo optional values to be assigned to each pre-processor variable. echo optional values to be assigned to each pre-processor variable.
echo If not supplied, the variable will be defined with no explicit value. echo If not supplied, the variable will be defined with no explicit value.
echo -h echo -h
echo Show this text and exit echo Show this text and exit
:End :End
+114 -116
View File
@@ -42,39 +42,39 @@ usage="USAGE: $progname [-w] [-d] [-h] <compiler-path> <def1>[=val1] [<def2>[=va
advice="Try '$progname -h' for more information" advice="Try '$progname -h' for more information"
while [ ! -z "$1" ]; do while [ ! -z "$1" ]; do
case $1 in case $1 in
-d ) -d )
set -x set -x
;; ;;
-w ) -w )
wintool=y wintool=y
;; ;;
-h ) -h )
echo "$progname is a tool for flexible generation of command line pre-processor" echo "$progname is a tool for flexible generation of command line pre-processor"
echo "definitions arguments for a variety of diffent compilers in a variety of" echo "definitions arguments for a variety of diffent compilers in a variety of"
echo "compilation environments" echo "compilation environments"
echo "" echo ""
echo $usage echo $usage
echo "" echo ""
echo "Where:" echo "Where:"
echo " <compiler-path>" echo " <compiler-path>"
echo " The full path to your compiler" echo " The full path to your compiler"
echo " <def1> <def2> [<def3> ..." echo " <def1> <def2> [<def3> ..."
echo " A list of pre-preprocesser variable names to be defined." echo " A list of pre-preprocesser variable names to be defined."
echo " [=val1] [=val2] [=val3]" echo " [=val1] [=val2] [=val3]"
echo " optional values to be assigned to each pre-processor variable." echo " optional values to be assigned to each pre-processor variable."
echo " If not supplied, the variable will be defined with no explicit value." echo " If not supplied, the variable will be defined with no explicit value."
echo " -w" echo " -w"
echo " The compiler is a Windows native tool and requires Windows" echo " The compiler is a Windows native tool and requires Windows"
echo " style pathnames like C:\\Program Files" echo " style pathnames like C:\\Program Files"
echo " -d" echo " -d"
echo " Enable script debug" echo " Enable script debug"
;; ;;
* ) * )
break; break;
;; ;;
esac esac
shift shift
done done
ccpath=$1 ccpath=$1
@@ -82,17 +82,17 @@ shift
varlist=$@ varlist=$@
if [ -z "$ccpath" ]; then if [ -z "$ccpath" ]; then
echo "Missing compiler path" echo "Missing compiler path"
echo $usage echo $usage
echo $advice echo $advice
exit 1 exit 1
fi fi
if [ -z "$varlist" ]; then if [ -z "$varlist" ]; then
echo "Missing definition list" echo "Missing definition list"
echo $usage echo $usage
echo $advice echo $advice
exit 1 exit 1
fi fi
# #
@@ -121,37 +121,37 @@ gcc=`echo $ccpath | grep gcc`
sdcc=`echo $ccpath | grep sdcc` sdcc=`echo $ccpath | grep sdcc`
if [ "X$os" = "XCygwin" ]; then if [ "X$os" = "XCygwin" ]; then
# #
# We can treat Cygwin native toolchains just like Linux native # We can treat Cygwin native toolchains just like Linux native
# toolchains in the Linux. Let's assume: # toolchains in the Linux. Let's assume:
# 1. GCC or SDCC are the only possible Cygwin native compilers # 1. GCC or SDCC are the only possible Cygwin native compilers
# 2. If this is a Window native GCC version, then -w provided # 2. If this is a Window native GCC version, then -w provided
# on the command line (wintool=y) # on the command line (wintool=y)
if [ -z "$gcc" -a -z "$sdcc" ]; then if [ -z "$gcc" -a -z "$sdcc" ]; then
# #
# Not GCC or SDCC, must be Windows native # Not GCC or SDCC, must be Windows native
# #
compiler=`cygpath -u "$ccpath"` compiler=`cygpath -u "$ccpath"`
else else
if [ "X$wintool" == "Xy" ]; then if [ "X$wintool" == "Xy" ]; then
# #
# It is a native GCC or SDCC compiler # It is a native GCC or SDCC compiler
# #
compiler=`cygpath -u "$ccpath"` compiler=`cygpath -u "$ccpath"`
else else
# #
# GCC or SDCC and not for Windows # GCC or SDCC and not for Windows
# #
compiler="$ccpath" compiler="$ccpath"
fi fi
fi fi
else else
# #
# Otherwise, we must be in a Linux environment where there are # Otherwise, we must be in a Linux environment where there are
# only Linux native toolchains # only Linux native toolchains
# #
compiler="$ccpath" compiler="$ccpath"
fi fi
exefile=`basename "$compiler"` exefile=`basename "$compiler"`
@@ -159,9 +159,9 @@ exefile=`basename "$compiler"`
# a special output format as well as special paths # a special output format as well as special paths
if [ "X$exefile" = "Xez8cc.exe" -o "X$exefile" = "Xzneocc.exe" -o "X$exefile" = "Xez80cc.exe" ]; then if [ "X$exefile" = "Xez8cc.exe" -o "X$exefile" = "Xzneocc.exe" -o "X$exefile" = "Xez80cc.exe" ]; then
fmt=define fmt=define
else else
fmt=std fmt=std
fi fi
# Now process each definition in the definition list # Now process each definition in the definition list
@@ -169,60 +169,58 @@ fi
unset response unset response
for vardef in $varlist; do for vardef in $varlist; do
varname=`echo $vardef | cut -d'=' -f1` varname=`echo $vardef | cut -d'=' -f1`
if [ "X$varname" != "X$vardef" ]; then if [ "X$varname" != "X$vardef" ]; then
varvalue=`echo $vardef | cut -d'=' -f2` varvalue=`echo $vardef | cut -d'=' -f2`
else else
unset varvalue unset varvalue
fi fi
# Handle the output depending on if there is a value for the variable or not # Handle the output depending on if there is a value for the variable or not
if [ -z "$varvalue" ]; then if [ -z "$varvalue" ]; then
# Handle the output using the selected format # Handle the output using the selected format
if [ "X$fmt" = "Xdefine" ]; then if [ "X$fmt" = "Xdefine" ]; then
# Treat the first definition differently # Treat the first definition differently
if [ -z "$response" ]; then if [ -z "$response" ]; then
response="-define:"$varname response="-define:"$varname
else else
response=$response" -define:$varname" response=$response" -define:$varname"
fi fi
else else
# Treat the first definition differently # Treat the first definition differently
if [ -z "$response" ]; then if [ -z "$response" ]; then
response=-D$varname response=-D$varname
else else
response=$response" -D$varname" response=$response" -D$varname"
fi fi
fi fi
else else
# Handle the output using the selected format # Handle the output using the selected format
if [ "X$fmt" = "Xdefine" ]; then if [ "X$fmt" = "Xdefine" ]; then
# Treat the first definition differently # Treat the first definition differently
if [ -z "$response" ]; then if [ -z "$response" ]; then
response="-define:"$varname=$varvalue response="-define:"$varname=$varvalue
else else
response=$response" -define:$varname=$varvalue" response=$response" -define:$varname=$varvalue"
fi fi
else else
# Treat the first definition differently # Treat the first definition differently
if [ -z "$response" ]; then if [ -z "$response" ]; then
response=-D$varname=$varvalue response=-D$varname=$varvalue
else else
response=$response" -D$varname=$varvalue" response=$response" -D$varname=$varvalue"
fi fi
fi fi
fi fi
done done
echo $response echo $response
+11 -11
View File
@@ -151,15 +151,15 @@ echo %progname% is a tool for flexible generation of include path arguments for
echo variety of different compilers in a variety of compilation environments echo variety of different compilers in a variety of compilation environments
echo USAGE: %progname% [-w] [-d] [-s] [-h] ^<compiler-path^> ^<dir1^> [^<dir2^> [^<dir3^> ...]] echo USAGE: %progname% [-w] [-d] [-s] [-h] ^<compiler-path^> ^<dir1^> [^<dir2^> [^<dir3^> ...]]
echo Where: echo Where:
echo ^<compiler-path^> echo ^<compiler-path^>
echo The full path to your compiler echo The full path to your compiler
echo ^<dir1^> [^<dir2^> [^<dir3^> ...]] echo ^<dir1^> [^<dir2^> [^<dir3^> ...]]
echo A list of include directories echo A list of include directories
echo -w, -d echo -w, -d
echo For compatibility with incdir.sh (ignored) echo For compatibility with incdir.sh (ignored)
echo -s echo -s
echo Generate standard, system header file paths instead of normal user echo Generate standard, system header file paths instead of normal user
echo header file paths. echo header file paths.
echo -h echo -h
echo Shows this help text and exits. echo Shows this help text and exits.
:End :End
+111 -113
View File
@@ -41,44 +41,44 @@ usage="USAGE: $progname [-w] [-d] [-h] <compiler-path> <dir1> [<dir2> [<dir3> ..
advice="Try '$progname -h' for more information" advice="Try '$progname -h' for more information"
while [ ! -z "$1" ]; do while [ ! -z "$1" ]; do
case $1 in case $1 in
-d ) -d )
set -x set -x
;; ;;
-w ) -w )
wintool=y wintool=y
;; ;;
-s ) -s )
pathtype=system pathtype=system
;; ;;
-h ) -h )
echo "$progname is a tool for flexible generation of include path arguments for a" echo "$progname is a tool for flexible generation of include path arguments for a"
echo "variety of different compilers in a variety of compilation environments" echo "variety of different compilers in a variety of compilation environments"
echo "" echo ""
echo $usage echo $usage
echo "" echo ""
echo "Where:" echo "Where:"
echo " <compiler-path>" echo " <compiler-path>"
echo " The full path to your compiler" echo " The full path to your compiler"
echo " <dir1> [<dir2> [<dir3> ...]]" echo " <dir1> [<dir2> [<dir3> ...]]"
echo " A list of include directories" echo " A list of include directories"
echo " -w" echo " -w"
echo " The compiler is a Windows native tool and requires Windows" echo " The compiler is a Windows native tool and requires Windows"
echo " style pathnames like C:\\Program Files" echo " style pathnames like C:\\Program Files"
echo " -s" echo " -s"
echo " Generate standard, system header file paths instead of normal user" echo " Generate standard, system header file paths instead of normal user"
echo " header file paths." echo " header file paths."
echo " -d" echo " -d"
echo " Enable script debug" echo " Enable script debug"
echo " -h" echo " -h"
echo " Shows this help text and exits." echo " Shows this help text and exits."
exit 0 exit 0
;; ;;
* ) * )
break; break;
;; ;;
esac esac
shift shift
done done
ccpath=$1 ccpath=$1
@@ -86,17 +86,17 @@ shift
dirlist=$@ dirlist=$@
if [ -z "$ccpath" ]; then if [ -z "$ccpath" ]; then
echo "Missing compiler path" echo "Missing compiler path"
echo $usage echo $usage
echo $advice echo $advice
exit 1 exit 1
fi fi
if [ -z "$dirlist" ]; then if [ -z "$dirlist" ]; then
echo "Missing include directory list" echo "Missing include directory list"
echo $usage echo $usage
echo $advice echo $advice
exit 1 exit 1
fi fi
# #
@@ -132,32 +132,32 @@ fi
sdcc=`echo $ccpath | grep sdcc` sdcc=`echo $ccpath | grep sdcc`
if [ "X$os" = "XCygwin" ]; then if [ "X$os" = "XCygwin" ]; then
# We can treat Cygwin native toolchains just like Linux native # We can treat Cygwin native toolchains just like Linux native
# toolchains in the Linux. Let's assume: # toolchains in the Linux. Let's assume:
# 1. GCC or SDCC are the only possible Cygwin native compilers # 1. GCC or SDCC are the only possible Cygwin native compilers
# 2. If this is a Window native GCC version, then -w must be # 2. If this is a Window native GCC version, then -w must be
# provided on the command line (wintool=y) # provided on the command line (wintool=y)
if [ -z "$gcc" -a -z "$sdcc" ]; then if [ -z "$gcc" -a -z "$sdcc" ]; then
# Not GCC or SDCC, must be Windows native # Not GCC or SDCC, must be Windows native
windows=yes windows=yes
compiler=`cygpath -u "$ccpath"` compiler=`cygpath -u "$ccpath"`
else else
if [ "X$wintool" == "Xy" ]; then if [ "X$wintool" == "Xy" ]; then
# It is a native GCC or SDCC compiler # It is a native GCC or SDCC compiler
windows=yes windows=yes
compiler=`cygpath -u "$ccpath"` compiler=`cygpath -u "$ccpath"`
else else
# GCC or SDCC and not for Windows # GCC or SDCC and not for Windows
windows=no windows=no
compiler="$ccpath" compiler="$ccpath"
fi fi
fi fi
else else
# Otherwise, we must be in a Linux environment where there are # Otherwise, we must be in a Linux environment where there are
# only Linux native toolchains # only Linux native toolchains
windows=no windows=no
compiler="$ccpath" compiler="$ccpath"
fi fi
exefile=`basename "$compiler"` exefile=`basename "$compiler"`
@@ -165,25 +165,25 @@ exefile=`basename "$compiler"`
# a special output format as well as special paths # a special output format as well as special paths
if [ "X$exefile" = "Xez8cc.exe" -o "X$exefile" = "Xzneocc.exe" -o "X$exefile" = "Xez80cc.exe" ]; then if [ "X$exefile" = "Xez8cc.exe" -o "X$exefile" = "Xzneocc.exe" -o "X$exefile" = "Xez80cc.exe" ]; then
fmt=zds fmt=zds
else else
fmt=std fmt=std
fi fi
# Select system or user header file path command line option # Select system or user header file path command line option
if [ "X$fmt" = "Xzds" ]; then if [ "X$fmt" = "Xzds" ]; then
if [ "X$pathtype" = "Xsystem" ]; then if [ "X$pathtype" = "Xsystem" ]; then
cmdarg=-stdinc: cmdarg=-stdinc:
else else
cmdarg=-usrinc: cmdarg=-usrinc:
fi fi
else else
if [ "X$pathtype" = "Xsystem" ]; then if [ "X$pathtype" = "Xsystem" ]; then
cmdarg=-isystem cmdarg=-isystem
else else
cmdarg=-I cmdarg=-I
fi fi
fi fi
# Now process each directory in the directory list # Now process each directory in the directory list
@@ -191,47 +191,45 @@ fi
unset response unset response
for dir in $dirlist; do for dir in $dirlist; do
# Verify that the include directory exists # Verify that the include directory exists
if [ ! -d $dir ]; then if [ ! -d $dir ]; then
echo "Include path '$dir' does not exist" echo "Include path '$dir' does not exist"
echo $showusage echo $showusage
exit 1 exit 1
fi fi
# Check if the path needs to be extended for Windows-based tools under Cygwin # Check if the path needs to be extended for Windows-based tools under Cygwin
if [ "X$windows" = "Xyes" ]; then if [ "X$windows" = "Xyes" ]; then
path=`cygpath -w $dir` path=`cygpath -w $dir`
else else
path=$dir path=$dir
fi fi
# Handle the output using the selected format # Handle the output using the selected format
if [ "X$fmt" = "Xzds" ]; then if [ "X$fmt" = "Xzds" ]; then
# Treat the first directory differently # Treat the first directory differently
if [ -z "$response" ]; then if [ -z "$response" ]; then
response="${cmdarg}'"${path} response="${cmdarg}'"${path}
else else
response=${response}";${path}" response=${response}";${path}"
fi fi
else else
# Treat the first directory differently # Treat the first directory differently
if [ -z "$response" ]; then if [ -z "$response" ]; then
response="${cmdarg} \"$path\"" response="${cmdarg} \"$path\""
else else
response="${response} ${cmdarg} \"$path\"" response="${response} ${cmdarg} \"$path\""
fi fi
fi fi
done done
if [ "X$fmt" = "Xzds" ]; then if [ "X$fmt" = "Xzds" ]; then
response=$response"'" response=$response"'"
fi fi
echo $response echo $response
+66 -66
View File
@@ -70,66 +70,66 @@ mode=inplace
fca=-fca fca=-fca
while [ ! -z "${1}" ]; do while [ ! -z "${1}" ]; do
case ${1} in case ${1} in
-d ) -d )
set -x set -x
;; ;;
-p ) -p )
fca=-nfca fca=-nfca
;; ;;
-o ) -o )
shift shift
outfile=${1} outfile=${1}
mode=copy mode=copy
;; ;;
-h ) -h )
echo "$0 is a tool for generation of proper version files for the NuttX build" echo "$0 is a tool for generation of proper version files for the NuttX build"
echo "" echo ""
echo "USAGE:" echo "USAGE:"
echo " $0 [-d] [-p] -o <out-file> <in-file>" echo " $0 [-d] [-p] -o <out-file> <in-file>"
echo " $0 [-d] [-p] <in-file-list>" echo " $0 [-d] [-p] <in-file-list>"
echo " $0 [-d] -h" echo " $0 [-d] -h"
echo "" echo ""
echo "Where:" echo "Where:"
echo " -<in-file>" echo " -<in-file>"
echo " A single, unformatted input file" echo " A single, unformatted input file"
echo " -<in-file-list>" echo " -<in-file-list>"
echo " A list of unformatted input files that will be reformatted in place." echo " A list of unformatted input files that will be reformatted in place."
echo " -o <out-file>" echo " -o <out-file>"
echo " Write the single, reformatted <in-file> to <out-file>. <in-file>" echo " Write the single, reformatted <in-file> to <out-file>. <in-file>"
echo " will not be modified." echo " will not be modified."
echo " -d" echo " -d"
echo " Enable script debug" echo " Enable script debug"
echo " -p" echo " -p"
echo " Comments are pre-formatted. Do not reformat." echo " Comments are pre-formatted. Do not reformat."
echo " -h" echo " -h"
echo " Show this help message and exit" echo " Show this help message and exit"
exit 0 exit 0
;; ;;
* ) * )
if [ ! -r ${1} ]; then if [ ! -r ${1} ]; then
echo "Readable ${1} does not exist" echo "Readable ${1} does not exist"
echo ${advice} echo ${advice}
exit 1 exit 1
fi fi
if [ -z "${filelist}" ]; then if [ -z "${filelist}" ]; then
filelist="${1}" filelist="${1}"
files=single files=single
else else
filelist="${filelist} ${1}" filelist="${filelist} ${1}"
files=multiple files=multiple
fi fi
;; ;;
esac esac
shift shift
done done
# Verify that at least one input file was provided # Verify that at least one input file was provided
if [ "X${files}" == "Xnone" ]; then if [ "X${files}" == "Xnone" ]; then
echo "ERROR: Neither <in-file> nor <in-file-list> provided" echo "ERROR: Neither <in-file> nor <in-file-list> provided"
echo ${advice} echo ${advice}
exit 1 exit 1
fi fi
# Options # Options
@@ -139,16 +139,16 @@ options="-nbad -bap -bbb -nbbo -nbc -bl -bl2 -bls -nbs -cbi2 -ncdw -nce -ci2 -cl
# Perform the indentation # Perform the indentation
if [ "X${mode}" == "Xcopy" ]; then if [ "X${mode}" == "Xcopy" ]; then
if [ "X${files}" == "Xmultiple" ]; then if [ "X${files}" == "Xmultiple" ]; then
echo "ERROR: Only a single <in-file> can be used with the -o option" echo "ERROR: Only a single <in-file> can be used with the -o option"
echo ${advice} echo ${advice}
exit 1 exit 1
fi fi
if [ -f $outfile ]; then if [ -f $outfile ]; then
echo "Removing old $outfile" echo "Removing old $outfile"
rm $outfile || { echo "Failed to remove $outfile" ; exit 1 ; } rm $outfile || { echo "Failed to remove $outfile" ; exit 1 ; }
fi fi
indent $options $filelist -o $outfile indent $options $filelist -o $outfile
else else
indent $options $filelist indent $options $filelist
fi fi
+5 -6
View File
@@ -118,14 +118,13 @@ echo ERROR: Missing required argument
:ShowUsage :ShowUsage
echo USAGE: %0 ^<action^> [-a ^<appsdir^>] [-c ^<cygwindir^>] echo USAGE: %0 ^<action^> [-a ^<appsdir^>] [-c ^<cygwindir^>]
echo Where: echo Where:
echo ^<action^> is one of config, oldconf, or menuconfig echo ^<action^> is one of config, oldconf, or menuconfig
echo ^<appsdir^> is the relative path to the apps\ directory. echo ^<appsdir^> is the relative path to the apps\ directory.
echo This defaults to ..\apps echo This defaults to ..\apps
echo ^<cygwindir^> is the relative path to the Cygwin installation echo ^<cygwindir^> is the relative path to the Cygwin installation
echo directory. This defaults to C:\Cygwin echo directory. This defaults to C:\Cygwin
rem Restore the original PATH settings rem Restore the original PATH settings
:End :End
set PATH=%oldpath% set PATH=%oldpath%
+4 -4
View File
@@ -35,7 +35,7 @@ rem
set usemklink= set usemklink=
if "%1"=="-m" ( if "%1"=="-m" (
set usemklink="y" set usemklink="y"
shift shift
) )
@@ -84,7 +84,7 @@ rem Copy the directory
:MkLink :MkLink
if "%usemklink%"=="y" ( if "%usemklink%"=="y" (
/user:administrator mklink /d %src% %link% /user:administrator mklink /d %src% %link%
goto :End goto :End
) )
@@ -95,7 +95,7 @@ goto :End
:ShowUsage :ShowUsage
echo USAGE: %0 ^<src^> ^<link^> echo USAGE: %0 ^<src^> ^<link^>
echo Where: echo Where:
echo ^<src^> is the source directory to be linked echo ^<src^> is the source directory to be linked
echo ^<link^> is the link to be created echo ^<link^> is the link to be created
:End :End
+32 -33
View File
@@ -41,8 +41,8 @@ dest=$2
# Verify that arguments were provided # Verify that arguments were provided
if [ -z "${src}" -o -z "${dest}" ]; then if [ -z "${src}" -o -z "${dest}" ]; then
echo "Missing src and/or dest arguments" echo "Missing src and/or dest arguments"
exit 1 exit 1
fi fi
# Check if something already exists at the destination path replace it with # Check if something already exists at the destination path replace it with
@@ -52,61 +52,60 @@ fi
if [ -h "${dest}" ]; then if [ -h "${dest}" ]; then
# If the link is already created (and matches the request) do nothing # If the link is already created (and matches the request) do nothing
if [ "$(readlink ${dest})" = "${src}" ]; then if [ "$(readlink ${dest})" = "${src}" ]; then
exit 0 exit 0
fi fi
# Otherwise, remove the link # Otherwise, remove the link
rm -f "${dest}" rm -f "${dest}"
else else
# If the path exists and is a directory that contains the "fake link" # If the path exists and is a directory that contains the "fake link"
# mark, then treat it like a soft link (i.e., remove the directory) # mark, then treat it like a soft link (i.e., remove the directory)
if [ -d "${dest}" -a -f "${dest}/.fakelnk" ]; then if [ -d "${dest}" -a -f "${dest}/.fakelnk" ]; then
rm -rf "${dest}" rm -rf "${dest}"
else else
# Does anything exist at the destination path? # Does anything exist at the destination path?
if [ -e "${dest}" ]; then if [ -e "${dest}" ]; then
# It is something else (like a file) or directory that does # It is something else (like a file) or directory that does
# not contain the "fake link" mark # not contain the "fake link" mark
echo "${dest} already exists but is not a symbolic link" echo "${dest} already exists but is not a symbolic link"
exit 1 exit 1
fi fi
fi fi
fi fi
# Verify that a directory exists at the source path # Verify that a directory exists at the source path
if [ ! -d "${src}" ]; then if [ ! -d "${src}" ]; then
echo "No directory at ${src}" echo "No directory at ${src}"
exit 1 exit 1
fi fi
# Create the soft link # Create the soft link
ln -s "${src}" "${dest}" || \ ln -s "${src}" "${dest}" || \
{ echo "Failed to create link: $dest" ; exit 1 ; } { echo "Failed to create link: $dest" ; exit 1 ; }
# Verify that the link was created # Verify that the link was created
if [ ! -h ${dest} ]; then if [ ! -h ${dest} ]; then
# The MSYS 'ln' command actually does a directory copy # The MSYS 'ln' command actually does a directory copy
if [ -d ${dest} ]; then if [ -d ${dest} ]; then
# Create the .fakelnk for unlink.sh # Create the .fakelnk for unlink.sh
touch ${dest}/.fakelnk touch ${dest}/.fakelnk
else else
echo "Error: link at ${dest} not created." echo "Error: link at ${dest} not created."
exit 1 exit 1
fi fi
fi fi
+33 -33
View File
@@ -38,37 +38,37 @@ ADVICE="Try '$0 -h' for more information"
unset VERSION unset VERSION
while [ ! -z "$1" ]; do while [ ! -z "$1" ]; do
case $1 in case $1 in
-v ) -v )
shift
VERSION=$1
;;
-d )
set -x
;;
-h )
echo "$0 is a tool for generation of configuration variable documentation"
echo ""
echo $USAGE
echo ""
echo "Where:"
echo " -v <major.minor>"
echo " The NuttX version number expressed as a major and minor number separated"
echo " by a period"
echo " -d"
echo " Enable script debug"
echo " -h"
echo " show this help message and exit"
exit 0
;;
* )
echo "Unrecognized option: ${1}"
echo $USAGE
echo $ADVICE
exit 1
;;
esac
shift shift
VERSION=$1
;;
-d )
set -x
;;
-h )
echo "$0 is a tool for generation of configuration variable documentation"
echo ""
echo $USAGE
echo ""
echo "Where:"
echo " -v <major.minor>"
echo " The NuttX version number expressed as a major and minor number separated"
echo " by a period"
echo " -d"
echo " Enable script debug"
echo " -h"
echo " show this help message and exit"
exit 0
;;
* )
echo "Unrecognized option: ${1}"
echo $USAGE
echo $ADVICE
exit 1
;;
esac
shift
done done
# Find the directory we were executed from and were we expect to # Find the directory we were executed from and were we expect to
@@ -84,12 +84,12 @@ HTMLFILE=Documentation/NuttXConfigVariables.html
BKUPFILE=Documentation/NuttXConfigVariables.bkp BKUPFILE=Documentation/NuttXConfigVariables.bkp
if [ -x ./${MYNAME} ] ; then if [ -x ./${MYNAME} ] ; then
cd .. || { echo "ERROR: cd .. failed" ; exit 1 ; } cd .. || { echo "ERROR: cd .. failed" ; exit 1 ; }
fi fi
if [ ! -x tools/${MYNAME} ] ; then if [ ! -x tools/${MYNAME} ] ; then
echo "ERROR: This file must be executed from the top-level NuttX directory: $PWD" echo "ERROR: This file must be executed from the top-level NuttX directory: $PWD"
exit 1 exit 1
fi fi
WD=${PWD} WD=${PWD}
+1 -1
View File
@@ -35,7 +35,7 @@
WD=`pwd` WD=`pwd`
if [[ "$WD" =~ "nuttx/tools" ]] if [[ "$WD" =~ "nuttx/tools" ]]
then then
cd .. cd ..
fi fi
find .. -type f -iname "*.[chs]" -o -iname "*.cxx" -o -iname "*.hxx" | xargs ctags -a find .. -type f -iname "*.[chs]" -o -iname "*.cxx" -o -iname "*.hxx" | xargs ctags -a
+168 -168
View File
@@ -45,97 +45,97 @@ WINTOOL=n
LIBEXT=.a LIBEXT=.a
while [ ! -z "$1" ]; do while [ ! -z "$1" ]; do
case $1 in case $1 in
-a ) -a )
shift shift
APPDIR="$1" APPDIR="$1"
;; ;;
-d ) -d )
set -x set -x
;; ;;
-l ) -l )
shift shift
LIBLIST=$1 LIBLIST=$1
;; ;;
-m ) -m )
shift shift
MAKE="$1" MAKE="$1"
;; ;;
-wy ) -wy )
WINTOOL=y WINTOOL=y
;; ;;
-w | -wn ) -w | -wn )
WINTOOL=n WINTOOL=n
;; ;;
-t ) -t )
shift shift
TOPDIR=$1 TOPDIR=$1
;; ;;
-u ) -u )
USRONLY=y USRONLY=y
;; ;;
-x ) -x )
shift shift
LIBEXT=$1 LIBEXT=$1
;; ;;
-z ) -z )
TGZ=y TGZ=y
;; ;;
-h ) -h )
echo $USAGE echo $USAGE
exit 0 exit 0
;; ;;
* ) * )
echo "Unrecognized argument: $1" echo "Unrecognized argument: $1"
echo $USAGE echo $USAGE
exit 1 exit 1
;; ;;
esac esac
shift shift
done done
# Check arguments # Check arguments
if [ -z "${TOPDIR}" -o -z "${LIBLIST}" ]; then if [ -z "${TOPDIR}" -o -z "${LIBLIST}" ]; then
echo "MK: Missing required arguments" echo "MK: Missing required arguments"
echo $USAGE echo $USAGE
exit 1 exit 1
fi fi
if [ ! -d "${TOPDIR}" ]; then if [ ! -d "${TOPDIR}" ]; then
echo "MK: Directory ${TOPDIR} does not exist" echo "MK: Directory ${TOPDIR} does not exist"
exit 1 exit 1
fi fi
# Check configuration # Check configuration
# Verify that we have Make.defs, .config, and .version files. # Verify that we have Make.defs, .config, and .version files.
if [ ! -f "${TOPDIR}/Make.defs" ]; then if [ ! -f "${TOPDIR}/Make.defs" ]; then
echo "MK: Directory ${TOPDIR}/Make.defs does not exist" echo "MK: Directory ${TOPDIR}/Make.defs does not exist"
exit 1 exit 1
fi fi
if [ ! -f "${TOPDIR}/.config" ]; then if [ ! -f "${TOPDIR}/.config" ]; then
echo "MK: Directory ${TOPDIR}/.config does not exist" echo "MK: Directory ${TOPDIR}/.config does not exist"
exit 1 exit 1
fi fi
if [ ! -f "${TOPDIR}/.version" ]; then if [ ! -f "${TOPDIR}/.version" ]; then
echo "MK: File ${TOPDIR}/.version does not exist" echo "MK: File ${TOPDIR}/.version does not exist"
exit 1 exit 1
fi fi
# Check if the make environment variable has been defined # Check if the make environment variable has been defined
if [ -z "${MAKE}" ]; then if [ -z "${MAKE}" ]; then
MAKE=`which make` MAKE=`which make`
fi fi
# Get the version string # Get the version string
source "${TOPDIR}/.version" source "${TOPDIR}/.version"
if [ ! -z "${CONFIG_VERSION_STRING}" -a "${CONFIG_VERSION_STRING}" != "0.0" ]; then if [ ! -z "${CONFIG_VERSION_STRING}" -a "${CONFIG_VERSION_STRING}" != "0.0" ]; then
VERSION="-${CONFIG_VERSION_STRING}" VERSION="-${CONFIG_VERSION_STRING}"
fi fi
# Create the export directory # Create the export directory
@@ -146,8 +146,8 @@ EXPORTDIR="${TOPDIR}/${EXPORTSUBDIR}"
# If the export directory already exists, then remove it and create a new one # If the export directory already exists, then remove it and create a new one
if [ -d "${EXPORTDIR}" ]; then if [ -d "${EXPORTDIR}" ]; then
echo "MK: Removing old export directory" echo "MK: Removing old export directory"
rm -rf "${EXPORTDIR}" rm -rf "${EXPORTDIR}"
fi fi
# Remove any possible previous results # Remove any possible previous results
@@ -187,8 +187,8 @@ rm -f "${EXPORTDIR}/Make.defs"
# Verify the build info that we got from makeinfo.sh # Verify the build info that we got from makeinfo.sh
if [ ! -d "${ARCHDIR}" ]; then if [ ! -d "${ARCHDIR}" ]; then
echo "MK: Directory ${ARCHDIR} does not exist" echo "MK: Directory ${ARCHDIR} does not exist"
exit 1 exit 1
fi fi
# Copy the default linker script # Copy the default linker script
@@ -198,27 +198,27 @@ cp -f "${TOPDIR}/binfmt/libelf/gnu-elf.ld" "${EXPORTDIR}/scripts/."
# Is there a linker script in this configuration? # Is there a linker script in this configuration?
if [ "X${USRONLY}" != "Xy" ]; then if [ "X${USRONLY}" != "Xy" ]; then
if [ ! -z "${LDPATH}" ]; then if [ ! -z "${LDPATH}" ]; then
# Apparently so. Verify that the script exists # Apparently so. Verify that the script exists
if [ ! -f "${LDPATH}" ]; then if [ ! -f "${LDPATH}" ]; then
echo "MK: File ${LDPATH} does not exist" echo "MK: File ${LDPATH} does not exist"
exit 1 exit 1
fi fi
# Copy the linker script # Copy the linker script
cp -p "${LDPATH}" "${EXPORTDIR}/scripts/." || \ cp -p "${LDPATH}" "${EXPORTDIR}/scripts/." || \
{ echo "MK: cp ${LDPATH} failed"; exit 1; } { echo "MK: cp ${LDPATH} failed"; exit 1; }
# Copy addtional ld scripts # Copy addtional ld scripts
LDDIR="$(dirname "${LDPATH}")" LDDIR="$(dirname "${LDPATH}")"
for f in "${LDDIR}"/*.ld ; do for f in "${LDDIR}"/*.ld ; do
[ -f "${f}" ] && cp -f "${f}" "${EXPORTDIR}/scripts/." [ -f "${f}" ] && cp -f "${f}" "${EXPORTDIR}/scripts/."
done done
fi fi
fi fi
# Save the compilation options # Save the compilation options
@@ -258,20 +258,20 @@ echo "LDSCRIPT = ${LDSCRIPT}" >>"${EXPORTDIR}/scripts/Make.defs"
# Additional compilation options when the kernel is built # Additional compilation options when the kernel is built
if [ "X${USRONLY}" != "Xy" ]; then if [ "X${USRONLY}" != "Xy" ]; then
echo "LDFLAGS = ${LDFLAGS}" >>"${EXPORTDIR}/scripts/Make.defs" echo "LDFLAGS = ${LDFLAGS}" >>"${EXPORTDIR}/scripts/Make.defs"
echo "HEAD_OBJ = ${HEAD_OBJ}" >>"${EXPORTDIR}/scripts/Make.defs" echo "HEAD_OBJ = ${HEAD_OBJ}" >>"${EXPORTDIR}/scripts/Make.defs"
echo "EXTRA_OBJS = ${EXTRA_OBJS}" >>"${EXPORTDIR}/scripts/Make.defs" echo "EXTRA_OBJS = ${EXTRA_OBJS}" >>"${EXPORTDIR}/scripts/Make.defs"
echo "LDSTARTGROUP = ${LDSTARTGROUP}" >>"${EXPORTDIR}/scripts/Make.defs" echo "LDSTARTGROUP = ${LDSTARTGROUP}" >>"${EXPORTDIR}/scripts/Make.defs"
echo "LDLIBS = ${LDLIBS}" >>"${EXPORTDIR}/scripts/Make.defs" echo "LDLIBS = ${LDLIBS}" >>"${EXPORTDIR}/scripts/Make.defs"
echo "EXTRA_LIBS = ${EXTRA_LIBS}" >>"${EXPORTDIR}/scripts/Make.defs" echo "EXTRA_LIBS = ${EXTRA_LIBS}" >>"${EXPORTDIR}/scripts/Make.defs"
echo "LIBGCC = ${LIBGCC}" >>"${EXPORTDIR}/scripts/Make.defs" echo "LIBGCC = ${LIBGCC}" >>"${EXPORTDIR}/scripts/Make.defs"
echo "LDENDGROUP = ${LDENDGROUP}" >>"${EXPORTDIR}/scripts/Make.defs" echo "LDENDGROUP = ${LDENDGROUP}" >>"${EXPORTDIR}/scripts/Make.defs"
fi fi
# Copy the system map file(s) # Copy the system map file(s)
if [ -r ${TOPDIR}/System.map ]; then if [ -r ${TOPDIR}/System.map ]; then
cp -a "${TOPDIR}/System.map" "${EXPORTDIR}/." cp -a "${TOPDIR}/System.map" "${EXPORTDIR}/."
fi fi
if [ -r ${TOPDIR}/User.map ]; then if [ -r ${TOPDIR}/User.map ]; then
@@ -281,7 +281,7 @@ fi
# Copy the NuttX include directory (retaining attributes and following symbolic links) # Copy the NuttX include directory (retaining attributes and following symbolic links)
cp -LR -p "${TOPDIR}/include" "${EXPORTDIR}/." || \ cp -LR -p "${TOPDIR}/include" "${EXPORTDIR}/." || \
{ echo "MK: 'cp ${TOPDIR}/include' failed"; exit 1; } { echo "MK: 'cp ${TOPDIR}/include' failed"; exit 1; }
# Copy the startup object file(s) # Copy the startup object file(s)
@@ -303,112 +303,112 @@ cp -f "${ARCHDIR}"/*.h "${EXPORTDIR}"/arch/. 2>/dev/null
# those directories into the EXPORTDIR # those directories into the EXPORTDIR
if [ "X${USRONLY}" != "Xy" ]; then if [ "X${USRONLY}" != "Xy" ]; then
ARCH_HDRDIRS="arm armv7-m avr avr32 board common chip mips32" ARCH_HDRDIRS="arm armv7-m avr avr32 board common chip mips32"
for hdir in $ARCH_HDRDIRS; do for hdir in $ARCH_HDRDIRS; do
# Does the directory (or symbolic link) exist? # Does the directory (or symbolic link) exist?
if [ -d "${ARCHDIR}/${hdir}" -o -h "${ARCHDIR}/${hdir}" ]; then if [ -d "${ARCHDIR}/${hdir}" -o -h "${ARCHDIR}/${hdir}" ]; then
# Yes.. create a export sub-directory of the same name # Yes.. create a export sub-directory of the same name
mkdir "${EXPORTDIR}/arch/${hdir}" || \ mkdir "${EXPORTDIR}/arch/${hdir}" || \
{ echo "MK: 'mkdir ${EXPORTDIR}/arch/${hdir}' failed"; exit 1; } { echo "MK: 'mkdir ${EXPORTDIR}/arch/${hdir}' failed"; exit 1; }
# Then copy the header files (only) into the new directory # Then copy the header files (only) into the new directory
cp -f "${ARCHDIR}"/${hdir}/*.h "${EXPORTDIR}"/arch/${hdir}/. 2>/dev/null cp -f "${ARCHDIR}"/${hdir}/*.h "${EXPORTDIR}"/arch/${hdir}/. 2>/dev/null
# Most architectures have low directory called "hardware" that # Most architectures have low directory called "hardware" that
# holds the header files # holds the header files
if [ -d "${ARCHDIR}/${hdir}/hardware" ]; then if [ -d "${ARCHDIR}/${hdir}/hardware" ]; then
# Yes.. create a export sub-directory of the same name # Yes.. create a export sub-directory of the same name
mkdir "${EXPORTDIR}/arch/${hdir}/hardware" || \ mkdir "${EXPORTDIR}/arch/${hdir}/hardware" || \
{ echo "MK: 'mkdir ${EXPORTDIR}/arch/${hdir}/hardware' failed"; exit 1; } { echo "MK: 'mkdir ${EXPORTDIR}/arch/${hdir}/hardware' failed"; exit 1; }
# Then copy the header files (only) into the new directory # Then copy the header files (only) into the new directory
cp -f "${ARCHDIR}"/${hdir}/hardware/*.h "${EXPORTDIR}"/arch/${hdir}/hardware/. 2>/dev/null cp -f "${ARCHDIR}"/${hdir}/hardware/*.h "${EXPORTDIR}"/arch/${hdir}/hardware/. 2>/dev/null
fi fi
fi fi
done done
# Copy OS internal header files as well. They are used by some architecture- # Copy OS internal header files as well. They are used by some architecture-
# specific header files. # specific header files.
mkdir "${EXPORTDIR}/arch/os" || \ mkdir "${EXPORTDIR}/arch/os" || \
{ echo "MK: 'mkdir ${EXPORTDIR}/arch/os' failed"; exit 1; } { echo "MK: 'mkdir ${EXPORTDIR}/arch/os' failed"; exit 1; }
OSDIRS="clock environ errno group init irq mqueue paging pthread sched semaphore signal task timer wdog" OSDIRS="clock environ errno group init irq mqueue paging pthread sched semaphore signal task timer wdog"
for dir in ${OSDIRS}; do for dir in ${OSDIRS}; do
mkdir "${EXPORTDIR}/arch/os/${dir}" || \ mkdir "${EXPORTDIR}/arch/os/${dir}" || \
{ echo "MK: 'mkdir ${EXPORTDIR}/arch/os/${dir}' failed"; exit 1; } { echo "MK: 'mkdir ${EXPORTDIR}/arch/os/${dir}' failed"; exit 1; }
cp -f "${TOPDIR}"/sched/${dir}/*.h "${EXPORTDIR}"/arch/os/${dir}/. 2>/dev/null cp -f "${TOPDIR}"/sched/${dir}/*.h "${EXPORTDIR}"/arch/os/${dir}/. 2>/dev/null
done done
# Add the board library to the list of libraries # Add the board library to the list of libraries
if [ -f "${ARCHDIR}/board/libboard${LIBEXT}" ]; then if [ -f "${ARCHDIR}/board/libboard${LIBEXT}" ]; then
LIBLIST="${LIBLIST} ${ARCHSUBDIR}/board/libboard${LIBEXT}" LIBLIST="${LIBLIST} ${ARCHSUBDIR}/board/libboard${LIBEXT}"
fi fi
fi fi
# Then process each library # Then process each library
AR=${CROSSDEV}ar AR=${CROSSDEV}ar
for lib in ${LIBLIST}; do for lib in ${LIBLIST}; do
if [ ! -f "${TOPDIR}/${lib}" ]; then if [ ! -f "${TOPDIR}/${lib}" ]; then
echo "MK: Library ${TOPDIR}/${lib} does not exist" echo "MK: Library ${TOPDIR}/${lib} does not exist"
exit 1 exit 1
fi fi
# Get some shorter names for the library # Get some shorter names for the library
libname=`basename ${lib} ${LIBEXT}` libname=`basename ${lib} ${LIBEXT}`
shortname=`echo ${libname} | sed -e "s/^lib//g"` shortname=`echo ${libname} | sed -e "s/^lib//g"`
# Copy the application library unmodified # Copy the application library unmodified
if [ "X${libname}" = "Xlibapps" ]; then if [ "X${libname}" = "Xlibapps" ]; then
cp -p "${TOPDIR}/${lib}" "${EXPORTDIR}/libs/." || \ cp -p "${TOPDIR}/${lib}" "${EXPORTDIR}/libs/." || \
{ echo "MK: cp ${TOPDIR}/${lib} failed"; exit 1; } { echo "MK: cp ${TOPDIR}/${lib} failed"; exit 1; }
else else
# Create a temporary directory and extract all of the objects there # Create a temporary directory and extract all of the objects there
# Hmmm.. this probably won't work if the archiver is not 'ar' # Hmmm.. this probably won't work if the archiver is not 'ar'
mkdir "${EXPORTDIR}/tmp" || \ mkdir "${EXPORTDIR}/tmp" || \
{ echo "MK: 'mkdir ${EXPORTDIR}/tmp' failed"; exit 1; } { echo "MK: 'mkdir ${EXPORTDIR}/tmp' failed"; exit 1; }
cd "${EXPORTDIR}/tmp" || \ cd "${EXPORTDIR}/tmp" || \
{ echo "MK: 'cd ${EXPORTDIR}/tmp' failed"; exit 1; } { echo "MK: 'cd ${EXPORTDIR}/tmp' failed"; exit 1; }
if [ "X${WINTOOL}" = "Xy" ]; then if [ "X${WINTOOL}" = "Xy" ]; then
WLIB=`cygpath -w "${TOPDIR}/${lib}"` WLIB=`cygpath -w "${TOPDIR}/${lib}"`
${AR} x "${WLIB}" ${AR} x "${WLIB}"
else else
${AR} x "${TOPDIR}/${lib}" ${AR} x "${TOPDIR}/${lib}"
fi fi
# Rename each object file (to avoid collision when they are combined) # Rename each object file (to avoid collision when they are combined)
# and add the file to libnuttx # and add the file to libnuttx
for file in `ls`; do for file in `ls`; do
mv "${file}" "${shortname}-${file}" mv "${file}" "${shortname}-${file}"
if [ "X${WINTOOL}" = "Xy" ]; then if [ "X${WINTOOL}" = "Xy" ]; then
WLIB=`cygpath -w "${EXPORTDIR}/libs/libnuttx${LIBEXT}"` WLIB=`cygpath -w "${EXPORTDIR}/libs/libnuttx${LIBEXT}"`
${AR} rcs "${WLIB}" "${shortname}-${file}" ${AR} rcs "${WLIB}" "${shortname}-${file}"
else else
${AR} rcs "${EXPORTDIR}/libs/libnuttx${LIBEXT}" "${shortname}-${file}" ${AR} rcs "${EXPORTDIR}/libs/libnuttx${LIBEXT}" "${shortname}-${file}"
fi fi
done done
cd "${TOPDIR}" || \ cd "${TOPDIR}" || \
{ echo "MK: 'cd ${TOPDIR}' failed"; exit 1; } { echo "MK: 'cd ${TOPDIR}' failed"; exit 1; }
rm -rf "${EXPORTDIR}/tmp" rm -rf "${EXPORTDIR}/tmp"
fi fi
done done
# Copy the essential build script file(s) # Copy the essential build script file(s)
@@ -427,18 +427,18 @@ cp -f "${TOPDIR}/tools/unlink.sh" "${EXPORTDIR}/tools/"
# Now tar up the whole export directory # Now tar up the whole export directory
cd "${TOPDIR}" || \ cd "${TOPDIR}" || \
{ echo "MK: 'cd ${TOPDIR}' failed"; exit 1; } { echo "MK: 'cd ${TOPDIR}' failed"; exit 1; }
if [ -e "${APPDIR}/Makefile" ]; then if [ -e "${APPDIR}/Makefile" ]; then
"${MAKE}" -C "${TOPDIR}/${APPDIR}" EXPORTDIR="$(cd "${EXPORTSUBDIR}" ; pwd )" TOPDIR="${TOPDIR}" export || \ "${MAKE}" -C "${TOPDIR}/${APPDIR}" EXPORTDIR="$(cd "${EXPORTSUBDIR}" ; pwd )" TOPDIR="${TOPDIR}" export || \
{ echo "MK: call make export for APPDIR not supported"; } { echo "MK: call make export for APPDIR not supported"; }
fi fi
if [ "X${TGZ}" = "Xy" ]; then if [ "X${TGZ}" = "Xy" ]; then
tar cvf "${EXPORTSUBDIR}.tar" "${EXPORTSUBDIR}" 1>/dev/null 2>&1 tar cvf "${EXPORTSUBDIR}.tar" "${EXPORTSUBDIR}" 1>/dev/null 2>&1
gzip -f "${EXPORTSUBDIR}.tar" gzip -f "${EXPORTSUBDIR}.tar"
else else
zip -r "${EXPORTSUBDIR}.zip" "${EXPORTSUBDIR}" 1>/dev/null 2>&1 zip -r "${EXPORTSUBDIR}.zip" "${EXPORTSUBDIR}" 1>/dev/null 2>&1
fi fi
# Clean up after ourselves # Clean up after ourselves
+52 -52
View File
@@ -53,16 +53,16 @@ usage="USAGE: $0 [-nofat] <topdir>"
# Verify if we have the optional "-nofat" # Verify if we have the optional "-nofat"
if [ "$nofat" == "-nofat" ]; then if [ "$nofat" == "-nofat" ]; then
echo "We will not mount a FAT/RAMDISK!" echo "We will not mount a FAT/RAMDISK!"
usefat=false usefat=false
else else
topdir=$1 topdir=$1
fi fi
if [ -z "$topdir" -o ! -d "$topdir" ]; then if [ -z "$topdir" -o ! -d "$topdir" ]; then
echo "The full path to the NuttX base directory must be provided on the command line" echo "The full path to the NuttX base directory must be provided on the command line"
echo $usage echo $usage
exit 1 exit 1
fi fi
# Extract all values from the .config in the $topdir that contains all of the NuttX # Extract all values from the .config in the $topdir that contains all of the NuttX
@@ -71,9 +71,9 @@ fi
# to make that practical # to make that practical
if [ ! -r $topdir/.config ]; then if [ ! -r $topdir/.config ]; then
echo "No readable file at $topdir/.config" echo "No readable file at $topdir/.config"
echo "Has NuttX been configured?" echo "Has NuttX been configured?"
exit 1 exit 1
fi fi
romfsetc=`grep CONFIG_NSH_ROMFSETC= $topdir/.config | cut -d'=' -f2` romfsetc=`grep CONFIG_NSH_ROMFSETC= $topdir/.config | cut -d'=' -f2`
@@ -102,42 +102,42 @@ fi
# Mountpoint support must be enabled # Mountpoint support must be enabled
if [ "X$disablempt" = "Xy" ]; then if [ "X$disablempt" = "Xy" ]; then
echo "Mountpoint support is required for this feature" echo "Mountpoint support is required for this feature"
echo "Set CONFIG_DISABLE_MOUNTPOINT=n to continue" echo "Set CONFIG_DISABLE_MOUNTPOINT=n to continue"
exit 1 exit 1
fi fi
# Scripting support must be enabled # Scripting support must be enabled
if [ "X$disablescript" = "Xy" ]; then if [ "X$disablescript" = "Xy" ]; then
echo "NSH scripting support is required for this feature" echo "NSH scripting support is required for this feature"
echo "Set CONFIG_NSH_DISABLESCRIPT=n to continue" echo "Set CONFIG_NSH_DISABLESCRIPT=n to continue"
exit 1 exit 1
fi fi
# We need at least 5 file descriptors: One for the ROMFS mount and one for # We need at least 5 file descriptors: One for the ROMFS mount and one for
# FAT mount performed in rcS, plus three for stdio. # FAT mount performed in rcS, plus three for stdio.
if [ -z "$ndescriptors" -o "$ndescriptors" -lt 5 ]; then if [ -z "$ndescriptors" -o "$ndescriptors" -lt 5 ]; then
echo "Insufficient file descriptors have been allocated" echo "Insufficient file descriptors have been allocated"
echo "Set CONFIG_NFILE_DESCRIPTORS to value greater than 4" echo "Set CONFIG_NFILE_DESCRIPTORS to value greater than 4"
exit 1 exit 1
fi fi
# ROMFS support is required, of course # ROMFS support is required, of course
if [ "X$romfs" != "Xy" ]; then if [ "X$romfs" != "Xy" ]; then
echo "ROMFS support is disabled in the NuttX configuration" echo "ROMFS support is disabled in the NuttX configuration"
echo "Set CONFIG_FS_ROMFS=y to continue" echo "Set CONFIG_FS_ROMFS=y to continue"
exit 0 exit 0
fi fi
# If it is the default rcS.template, then it also requires FAT FS support # If it is the default rcS.template, then it also requires FAT FS support
if [ "$usefat" = true -a "X$fatfs" != "Xy" ]; then if [ "$usefat" = true -a "X$fatfs" != "Xy" ]; then
echo "FAT FS support is disabled in the NuttX configuration" echo "FAT FS support is disabled in the NuttX configuration"
echo "Set CONFIG_FS_FAT=y to continue" echo "Set CONFIG_FS_FAT=y to continue"
exit 0 exit 0
fi fi
# Verify that genromfs has been installed # Verify that genromfs has been installed
@@ -151,16 +151,16 @@ genromfs -h 1>/dev/null 2>&1 || { \
# Supply defaults for all un-defined ROMFS settings # Supply defaults for all un-defined ROMFS settings
if [ -z "$romfsmpt" ]; then if [ -z "$romfsmpt" ]; then
romfsmpt="/etc" romfsmpt="/etc"
fi fi
if [ -z "$initscript" ]; then if [ -z "$initscript" ]; then
initscript="init.d/rcS" initscript="init.d/rcS"
fi fi
if [ -z "$romfsdevno" ]; then if [ -z "$romfsdevno" ]; then
romfsdevno=0 romfsdevno=0
fi fi
if [ -z "$romfssectsize" ]; then if [ -z "$romfssectsize" ]; then
romfssectsize=64 romfssectsize=64
fi fi
# If FAT FS is a requirement # If FAT FS is a requirement
@@ -170,16 +170,16 @@ if [ "$usefat" = true ]; then
# Supply defaults for all un-defined FAT FS settings # Supply defaults for all un-defined FAT FS settings
if [ -z "$fatdevno" ]; then if [ -z "$fatdevno" ]; then
fatdevno=1 fatdevno=1
fi fi
if [ -z "$fatsectsize" ]; then if [ -z "$fatsectsize" ]; then
fatsectsize=512 fatsectsize=512
fi fi
if [ -z "$fatnsectors" ]; then if [ -z "$fatnsectors" ]; then
fatnsectors=1024 fatnsectors=1024
fi fi
if [ -z "$fatmpt" ]; then if [ -z "$fatmpt" ]; then
fatmpt="/tmp" fatmpt="/tmp"
fi fi
fi fi
@@ -187,50 +187,50 @@ fi
# /., /./*, /.., or /../* # /., /./*, /.., or /../*
if [ ${romfsmpt:0:1} != "\"" ]; then if [ ${romfsmpt:0:1} != "\"" ]; then
echo "CONFIG_NSH_ROMFSMOUNTPT must be a string" echo "CONFIG_NSH_ROMFSMOUNTPT must be a string"
echo "Change it so that it is enclosed in quotes." echo "Change it so that it is enclosed in quotes."
exit 1 exit 1
fi fi
uromfsmpt=`echo $romfsmpt | sed -e "s/\"//g"` uromfsmpt=`echo $romfsmpt | sed -e "s/\"//g"`
if [ ${uromfsmpt:0:1} != "/" ]; then if [ ${uromfsmpt:0:1} != "/" ]; then
echo "CONFIG_NSH_ROMFSMOUNTPT must be an absolute path in the target FS" echo "CONFIG_NSH_ROMFSMOUNTPT must be an absolute path in the target FS"
echo "Change it so that it begins with the character '/'. Eg. /etc" echo "Change it so that it begins with the character '/'. Eg. /etc"
exit 1 exit 1
fi fi
tmpdir=$uromfsmpt tmpdir=$uromfsmpt
while [ ${tmpdir:0:1} == "/" ]; do while [ ${tmpdir:0:1} == "/" ]; do
tmpdir=${tmpdir:1} tmpdir=${tmpdir:1}
done done
if [ -z "$tmpdir" -o "X$tmpdir" = "Xdev" -o "X$tmpdir" = "." -o \ if [ -z "$tmpdir" -o "X$tmpdir" = "Xdev" -o "X$tmpdir" = "." -o \
${tmpdir:0:2} = "./" -o "X$tmpdir" = ".." -o ${tmpdir:0:3} = "../" ]; then ${tmpdir:0:2} = "./" -o "X$tmpdir" = ".." -o ${tmpdir:0:3} = "../" ]; then
echo "Invalid CONFIG_NSH_ROMFSMOUNTPT selection." echo "Invalid CONFIG_NSH_ROMFSMOUNTPT selection."
exit 1 exit 1
fi fi
# Verify that the path to the init file is a relative path and not ., ./*, .., or ../* # Verify that the path to the init file is a relative path and not ., ./*, .., or ../*
if [ ${initscript:0:1} != "\"" ]; then if [ ${initscript:0:1} != "\"" ]; then
echo "CONFIG_NSH_INITSCRIPT must be a string" echo "CONFIG_NSH_INITSCRIPT must be a string"
echo "Change it so that it is enclosed in quotes." echo "Change it so that it is enclosed in quotes."
exit 1 exit 1
fi fi
uinitscript=`echo $initscript | sed -e "s/\"//g"` uinitscript=`echo $initscript | sed -e "s/\"//g"`
if [ ${uinitscript:0:1} == "/" ]; then if [ ${uinitscript:0:1} == "/" ]; then
echo "CONFIG_NSH_INITSCRIPT must be an relative path in under $romfsmpt" echo "CONFIG_NSH_INITSCRIPT must be an relative path in under $romfsmpt"
echo "Change it so that it begins with the character '/'. Eg. init.d/rcS. " echo "Change it so that it begins with the character '/'. Eg. init.d/rcS. "
exit 1 exit 1
fi fi
if [ "X$uinitscript" = "." -o ${uinitscript:0:2} = "./" -o \ if [ "X$uinitscript" = "." -o ${uinitscript:0:2} = "./" -o \
"X$uinitscript" = ".." -o ${uinitscript:0:3} = "../" ]; then "X$uinitscript" = ".." -o ${uinitscript:0:3} = "../" ]; then
echo "Invalid CONFIG_NSH_INITSCRIPT selection. Must not begin with . or .." echo "Invalid CONFIG_NSH_INITSCRIPT selection. Must not begin with . or .."
exit 1 exit 1
fi fi
# Create a working directory # Create a working directory
@@ -241,9 +241,9 @@ mkdir -p $workingdir || { echo "Failed to created the new $workingdir"; exit 1;
# Create the rcS file from the rcS.template # Create the rcS file from the rcS.template
if [ ! -r $rcstemplate ]; then if [ ! -r $rcstemplate ]; then
echo "$rcstemplate does not exist" echo "$rcstemplate does not exist"
rmdir $workingdir rmdir $workingdir
exit 1 exit 1
fi fi
# If we are using FAT FS with RAMDISK we need to setup it # If we are using FAT FS with RAMDISK we need to setup it
+48 -48
View File
@@ -44,51 +44,51 @@ defaults=n
prompt=y prompt=y
while [ ! -z "$1" ]; do while [ ! -z "$1" ]; do
case $1 in case $1 in
--debug ) --debug )
set -x set -x
;; ;;
--silent ) --silent )
silent=y silent=y
defaults=y defaults=y
prompt=n prompt=n
;; ;;
--prompt ) --prompt )
prompt=y prompt=y
;; ;;
--defaults ) --defaults )
defaults=y defaults=y
;; ;;
--help ) --help )
echo "$0 is a tool for refreshing board configurations" echo "$0 is a tool for refreshing board configurations"
echo "" echo ""
echo $USAGE echo $USAGE
echo "" echo ""
echo "Where [options] include:" echo "Where [options] include:"
echo " --debug" echo " --debug"
echo " Enable script debug" echo " Enable script debug"
echo " --silent" echo " --silent"
echo " Update board configuration without interaction. Implies --defaults." echo " Update board configuration without interaction. Implies --defaults."
echo " Assumes no prompt for save. Use --silent --prompt to prompt before saving." echo " Assumes no prompt for save. Use --silent --prompt to prompt before saving."
echo " --prompt" echo " --prompt"
echo " Prompt before updating and overwriting the defconfig file. Default is to" echo " Prompt before updating and overwriting the defconfig file. Default is to"
echo " prompt unless --silent" echo " prompt unless --silent"
echo " --defaults" echo " --defaults"
echo " Do not prompt for new default selections; accept all recommended default values" echo " Do not prompt for new default selections; accept all recommended default values"
echo " --help" echo " --help"
echo " Show this help message and exit" echo " Show this help message and exit"
echo " <board>" echo " <board>"
echo " The board directory under nuttx/boards" echo " The board directory under nuttx/boards"
echo " <config>" echo " <config>"
echo " The board configuration directory under nuttx/boards/<board>/configs" echo " The board configuration directory under nuttx/boards/<board>/configs"
exit 0 exit 0
;; ;;
* ) * )
CONFIG=$1 CONFIG=$1
break break
;; ;;
esac esac
shift shift
done done
# Get the board configuration # Get the board configuration
@@ -153,12 +153,12 @@ fi
MYNAME=`basename $0` MYNAME=`basename $0`
if [ -x ./${MYNAME} ] ; then if [ -x ./${MYNAME} ] ; then
cd .. || { echo "ERROR: cd .. failed" ; exit 1 ; } cd .. || { echo "ERROR: cd .. failed" ; exit 1 ; }
fi fi
if [ ! -x tools/${MYNAME} ] ; then if [ ! -x tools/${MYNAME} ] ; then
echo "ERROR: This file must be executed from the top-level NuttX directory: $PWD" echo "ERROR: This file must be executed from the top-level NuttX directory: $PWD"
exit 1 exit 1
fi fi
# Set up the environment # Set up the environment
+116 -116
View File
@@ -41,70 +41,70 @@ hsize=64
unset configfile unset configfile
function showusage { function showusage {
echo "" echo ""
echo "USAGE: $progname [-w|l|m] [-c|u|g|n] [-32|64] [<config>]" echo "USAGE: $progname [-w|l|m] [-c|u|g|n] [-32|64] [<config>]"
echo " $progname -h" echo " $progname -h"
echo "" echo ""
echo "Where:" echo "Where:"
echo " -w|l|m selects Windows (w), Linux (l), or macOS (m). Default: Linux" echo " -w|l|m selects Windows (w), Linux (l), or macOS (m). Default: Linux"
echo " -c|u|g|n selects Windows environment option: Cygwin (c), Ubuntu under" echo " -c|u|g|n selects Windows environment option: Cygwin (c), Ubuntu under"
echo " Windows 10 (u), MSYS/MSYS2 (g) or Windows native (n). Default Cygwin" echo " Windows 10 (u), MSYS/MSYS2 (g) or Windows native (n). Default Cygwin"
echo " -32|64 selects 32- or 64-bit host. Default 64" echo " -32|64 selects 32- or 64-bit host. Default 64"
echo " -h will show this help test and terminate" echo " -h will show this help test and terminate"
echo " <config> selects configuration file. Default: .config" echo " <config> selects configuration file. Default: .config"
exit 1 exit 1
} }
# Parse command line # Parse command line
while [ ! -z "$1" ]; do while [ ! -z "$1" ]; do
case $1 in case $1 in
-w ) -w )
host=windows host=windows
;; ;;
-l ) -l )
host=linux host=linux
;; ;;
-c ) -c )
host=windows host=windows
wenv=cygwin wenv=cygwin
;; ;;
-g ) -g )
host=windows host=windows
wenv=msys wenv=msys
;; ;;
-u ) -u )
host=windows host=windows
wenv=ubuntu wenv=ubuntu
;; ;;
-m ) -m )
host=macos host=macos
;; ;;
-n ) -n )
host=windows host=windows
wenv=native wenv=native
;; ;;
-32 ) -32 )
hsize=32 hsize=32
;; ;;
-64 ) -64 )
hsize=32 hsize=32
;; ;;
-h ) -h )
showusage showusage
;; ;;
* ) * )
configfile="$1" configfile="$1"
shift shift
break; break;
;; ;;
esac esac
shift shift
done done
if [ ! -z "$1" ]; then if [ ! -z "$1" ]; then
echo "ERROR: Garbage at the end of line" echo "ERROR: Garbage at the end of line"
showusage showusage
fi fi
if [ -x sethost.sh ]; then if [ -x sethost.sh ]; then
@@ -178,82 +178,82 @@ fi
if [ "X$host" == "Xlinux" -o "X$host" == "Xmacos" ]; then if [ "X$host" == "Xlinux" -o "X$host" == "Xmacos" ]; then
# Enable Linux or macOS # Enable Linux or macOS
if [ "X$host" == "Xlinux" ]; then if [ "X$host" == "Xlinux" ]; then
echo " Select CONFIG_HOST_LINUX=y" echo " Select CONFIG_HOST_LINUX=y"
kconfig-tweak --file $nuttx/.config --enable CONFIG_HOST_LINUX kconfig-tweak --file $nuttx/.config --enable CONFIG_HOST_LINUX
kconfig-tweak --file $nuttx/.config --disable CONFIG_HOST_MACOS
else
echo " Select CONFIG_HOST_MACOS=y"
kconfig-tweak --file $nuttx/.config --disable CONFIG_HOST_LINUX
kconfig-tweak --file $nuttx/.config --enable CONFIG_HOST_MACOS
fi
# Disable all Windows options
kconfig-tweak --file $nuttx/.config --disable CONFIG_HOST_WINDOWS
kconfig-tweak --file $nuttx/.config --disable CONFIG_SIM_X8664_MICROSOFT
kconfig-tweak --file $nuttx/.config --enable CONFIG_SIM_X8664_SYSTEMV
kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_NATIVE
kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_CYGWIN
kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_UBUNTU
kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_MSYS
kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_OTHER
kconfig-tweak --file $nuttx/.config --enable CONFIG_SIM_X8664_SYSTEMV
kconfig-tweak --file $nuttx/.config --disable CONFIG_SIM_X8664_MICROSOFT
kconfig-tweak --file $nuttx/.config --disable CONFIG_SIM_M32
else
echo " Select CONFIG_HOST_WINDOWS=y"
# Enable Windows
kconfig-tweak --file $nuttx/.config --enable CONFIG_HOST_WINDOWS
kconfig-tweak --file $nuttx/.config --disable CONFIG_HOST_LINUX
kconfig-tweak --file $nuttx/.config --disable CONFIG_HOST_MACOS kconfig-tweak --file $nuttx/.config --disable CONFIG_HOST_MACOS
else
echo " Select CONFIG_HOST_MACOS=y"
kconfig-tweak --file $nuttx/.config --enable CONFIG_SIM_X8664_MICROSOFT kconfig-tweak --file $nuttx/.config --disable CONFIG_HOST_LINUX
kconfig-tweak --file $nuttx/.config --disable CONFIG_SIM_X8664_SYSTEMV kconfig-tweak --file $nuttx/.config --enable CONFIG_HOST_MACOS
fi
# Enable Windows environment # Disable all Windows options
kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_OTHER kconfig-tweak --file $nuttx/.config --disable CONFIG_HOST_WINDOWS
if [ "X$wenv" == "Xcygwin" ]; then kconfig-tweak --file $nuttx/.config --disable CONFIG_SIM_X8664_MICROSOFT
echo " Select CONFIG_WINDOWS_CYGWIN=y" kconfig-tweak --file $nuttx/.config --enable CONFIG_SIM_X8664_SYSTEMV
kconfig-tweak --file $nuttx/.config --enable CONFIG_WINDOWS_CYGWIN
kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_MSYS kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_NATIVE
kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_CYGWIN
kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_UBUNTU
kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_MSYS
kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_OTHER
kconfig-tweak --file $nuttx/.config --enable CONFIG_SIM_X8664_SYSTEMV
kconfig-tweak --file $nuttx/.config --disable CONFIG_SIM_X8664_MICROSOFT
kconfig-tweak --file $nuttx/.config --disable CONFIG_SIM_M32
else
echo " Select CONFIG_HOST_WINDOWS=y"
# Enable Windows
kconfig-tweak --file $nuttx/.config --enable CONFIG_HOST_WINDOWS
kconfig-tweak --file $nuttx/.config --disable CONFIG_HOST_LINUX
kconfig-tweak --file $nuttx/.config --disable CONFIG_HOST_MACOS
kconfig-tweak --file $nuttx/.config --enable CONFIG_SIM_X8664_MICROSOFT
kconfig-tweak --file $nuttx/.config --disable CONFIG_SIM_X8664_SYSTEMV
# Enable Windows environment
kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_OTHER
if [ "X$wenv" == "Xcygwin" ]; then
echo " Select CONFIG_WINDOWS_CYGWIN=y"
kconfig-tweak --file $nuttx/.config --enable CONFIG_WINDOWS_CYGWIN
kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_MSYS
kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_UBUNTU
kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_NATIVE
else
kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_CYGWIN
if [ "X$wenv" == "Xmsys" ]; then
echo " Select CONFIG_WINDOWS_MSYS=y"
kconfig-tweak --file $nuttx/.config --enable CONFIG_WINDOWS_MSYS
kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_UBUNTU kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_UBUNTU
kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_NATIVE kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_NATIVE
else else
kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_CYGWIN kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_MSYS
if [ "X$wenv" == "Xmsys" ]; then if [ "X$wenv" == "Xubuntu" ]; then
echo " Select CONFIG_WINDOWS_MSYS=y" echo " Select CONFIG_WINDOWS_UBUNTU=y"
kconfig-tweak --file $nuttx/.config --enable CONFIG_WINDOWS_MSYS kconfig-tweak --file $nuttx/.config --enable CONFIG_WINDOWS_UBUNTU
kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_UBUNTU
kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_NATIVE kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_NATIVE
else else
kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_MSYS echo " Select CONFIG_WINDOWS_NATIVE=y"
if [ "X$wenv" == "Xubuntu" ]; then kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_UBUNTU
echo " Select CONFIG_WINDOWS_UBUNTU=y" kconfig-tweak --file $nuttx/.config --enable CONFIG_WINDOWS_NATIVE
kconfig-tweak --file $nuttx/.config --enable CONFIG_WINDOWS_UBUNTU
kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_NATIVE
else
echo " Select CONFIG_WINDOWS_NATIVE=y"
kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_UBUNTU
kconfig-tweak --file $nuttx/.config --enable CONFIG_WINDOWS_NATIVE
fi
fi fi
fi fi
fi
if [ "X$hsize" == "X32" ]; then if [ "X$hsize" == "X32" ]; then
kconfig-tweak --file $nuttx/.config --enable CONFIG_SIM_M32 kconfig-tweak --file $nuttx/.config --enable CONFIG_SIM_M32
else else
kconfig-tweak --file $nuttx/.config --disable CONFIG_SIM_M32 kconfig-tweak --file $nuttx/.config --disable CONFIG_SIM_M32
fi fi
fi fi
kconfig-tweak --file $nuttx/.config --disable CONFIG_HOST_MACOS kconfig-tweak --file $nuttx/.config --disable CONFIG_HOST_MACOS
+182 -182
View File
@@ -48,78 +48,78 @@ unset testfile
unset JOPTION unset JOPTION
function showusage { function showusage {
echo "" echo ""
echo "USAGE: $progname [-w|l] [-c|u|n] [-s] [-d] [-x] [-j <ncpus>] [-a <apps-dir>] [-t <nuttx-dir><testlist-file>" echo "USAGE: $progname [-w|l] [-c|u|n] [-s] [-d] [-x] [-j <ncpus>] [-a <apps-dir>] [-t <nuttx-dir><testlist-file>"
echo " $progname -h" echo " $progname -h"
echo "" echo ""
echo "Where:" echo "Where:"
echo " -w|l selects Windows (w) or Linux (l). Default: Linux" echo " -w|l selects Windows (w) or Linux (l). Default: Linux"
echo " -c|u|n selects Windows environment option: Cygwin (c), Ubuntu under" echo " -c|u|n selects Windows environment option: Cygwin (c), Ubuntu under"
echo " Windows 10 (u), or Windows native (n). Default Cygwin" echo " Windows 10 (u), or Windows native (n). Default Cygwin"
echo " -s Use C++ unsigned long size_t in new operator. Default unsigned int" echo " -s Use C++ unsigned long size_t in new operator. Default unsigned int"
echo " -d enables script debug output" echo " -d enables script debug output"
echo " -x exit on build failures" echo " -x exit on build failures"
echo " -j <ncpus> passed on to make. Default: No -j make option." echo " -j <ncpus> passed on to make. Default: No -j make option."
echo " -a <appsdir> provides the relative path to the apps/ directory. Default ../apps" echo " -a <appsdir> provides the relative path to the apps/ directory. Default ../apps"
echo " -t <topdir> provides the absolute path to top nuttx/ directory. Default $PWD/../nuttx" echo " -t <topdir> provides the absolute path to top nuttx/ directory. Default $PWD/../nuttx"
echo " -h will show this help test and terminate" echo " -h will show this help test and terminate"
echo " <testlist-file> selects the list of configurations to test. No default" echo " <testlist-file> selects the list of configurations to test. No default"
echo "" echo ""
echo "Your PATH variable must include the path to both the build tools and the" echo "Your PATH variable must include the path to both the build tools and the"
echo "kconfig-frontends tools" echo "kconfig-frontends tools"
echo "" echo ""
exit 1 exit 1
} }
# Parse command line # Parse command line
while [ ! -z "$1" ]; do while [ ! -z "$1" ]; do
case $1 in case $1 in
-w ) -w )
host=windows host=windows
;; ;;
-l ) -l )
host=linux host=linux
;; ;;
-c ) -c )
host=windows host=windows
wenv=cygwin wenv=cygwin
;; ;;
-d ) -d )
set -x set -x
;; ;;
-u ) -u )
host=windows host=windows
wenv=ubuntu wenv=ubuntu
;; ;;
-n ) -n )
host=windows host=windows
wenv=native wenv=native
;; ;;
-s ) -s )
host=windows host=windows
sizet=long sizet=long
;; ;;
-x ) -x )
MAKE_FLAGS='--silent --no-print-directory' MAKE_FLAGS='--silent --no-print-directory'
set -e set -e
;; ;;
-a ) -a )
shift shift
APPSDIR="$1" APPSDIR="$1"
;; ;;
-j ) -j )
shift shift
JOPTION="-j $1" JOPTION="-j $1"
;; ;;
-t ) -t )
shift shift
nuttx="$1" nuttx="$1"
;; ;;
-h ) -h )
showusage showusage
;; ;;
* ) * )
testfile="$1" testfile="$1"
shift shift
break; break;
@@ -129,133 +129,133 @@ while [ ! -z "$1" ]; do
done done
if [ ! -z "$1" ]; then if [ ! -z "$1" ]; then
echo "ERROR: Garbage at the end of line" echo "ERROR: Garbage at the end of line"
showusage showusage
fi fi
if [ -z "$testfile" ]; then if [ -z "$testfile" ]; then
echo "ERROR: Missing test list file" echo "ERROR: Missing test list file"
showusage showusage
fi fi
if [ ! -r "$testfile" ]; then if [ ! -r "$testfile" ]; then
echo "ERROR: No readable file exists at $testfile" echo "ERROR: No readable file exists at $testfile"
showusage showusage
fi fi
if [ ! -d "$nuttx" ]; then if [ ! -d "$nuttx" ]; then
echo "ERROR: Expected to find nuttx/ at $nuttx" echo "ERROR: Expected to find nuttx/ at $nuttx"
showusage showusage
fi fi
# Clean up after the last build # Clean up after the last build
function distclean { function distclean {
cd $nuttx || { echo "ERROR: failed to CD to $nuttx"; exit 1; } cd $nuttx || { echo "ERROR: failed to CD to $nuttx"; exit 1; }
if [ -f .config ]; then if [ -f .config ]; then
echo " Cleaning..." echo " Cleaning..."
${MAKE} ${JOPTION} ${MAKE_FLAGS} distclean 1>/dev/null ${MAKE} ${JOPTION} ${MAKE_FLAGS} distclean 1>/dev/null
fi fi
} }
# Configure for the next build # Configure for the next build
function configure { function configure {
cd $nuttx/tools || { echo "ERROR: failed to CD to $nuttx/tools"; exit 1; } cd $nuttx/tools || { echo "ERROR: failed to CD to $nuttx/tools"; exit 1; }
echo " Configuring..." echo " Configuring..."
./configure.sh $config ./configure.sh $config
cd $nuttx || { echo "ERROR: failed to CD to $nuttx"; exit 1; } cd $nuttx || { echo "ERROR: failed to CD to $nuttx"; exit 1; }
if [ "X$host" == "Xlinux" ]; then if [ "X$host" == "Xlinux" ]; then
echo " Select CONFIG_HOST_LINUX=y" echo " Select CONFIG_HOST_LINUX=y"
kconfig-tweak --file $nuttx/.config --enable CONFIG_HOST_LINUX kconfig-tweak --file $nuttx/.config --enable CONFIG_HOST_LINUX
kconfig-tweak --file $nuttx/.config --disable CONFIG_HOST_WINDOWS kconfig-tweak --file $nuttx/.config --disable CONFIG_HOST_WINDOWS
kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_NATIVE
kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_CYGWIN
kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_MSYS
kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_OTHER
kconfig-tweak --file $nuttx/.config --enable CONFIG_SIM_X8664_SYSTEMV
kconfig-tweak --file $nuttx/.config --disable CONFIG_SIM_X8664_MICROSOFT
kconfig-tweak --file $nuttx/.config --disable CONFIG_SIM_M32
else
echo " Select CONFIG_HOST_WINDOWS=y"
kconfig-tweak --file $nuttx/.config --enable CONFIG_HOST_WINDOWS
kconfig-tweak --file $nuttx/.config --disable CONFIG_HOST_LINUX
if [ "X$wenv" == "Xcygwin" ]; then
echo " Select CONFIG_WINDOWS_CYGWIN=y"
kconfig-tweak --file $nuttx/.config --enable CONFIG_WINDOWS_CYGWIN
kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_UBUNTU
kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_NATIVE
else
kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_CYGWIN
if [ "X$wenv" == "Xubuntu" ]; then
echo " Select CONFIG_WINDOWS_UBUNTU=y"
kconfig-tweak --file $nuttx/.config --enable CONFIG_WINDOWS_UBUNTU
kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_NATIVE kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_NATIVE
kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_CYGWIN else
kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_MSYS echo " Select CONFIG_WINDOWS_NATIVE=y"
kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_OTHER kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_UBUNTU
kconfig-tweak --file $nuttx/.config --enable CONFIG_WINDOWS_NATIVE
kconfig-tweak --file $nuttx/.config --enable CONFIG_SIM_X8664_SYSTEMV fi
kconfig-tweak --file $nuttx/.config --disable CONFIG_SIM_X8664_MICROSOFT
kconfig-tweak --file $nuttx/.config --disable CONFIG_SIM_M32
else
echo " Select CONFIG_HOST_WINDOWS=y"
kconfig-tweak --file $nuttx/.config --enable CONFIG_HOST_WINDOWS
kconfig-tweak --file $nuttx/.config --disable CONFIG_HOST_LINUX
if [ "X$wenv" == "Xcygwin" ]; then
echo " Select CONFIG_WINDOWS_CYGWIN=y"
kconfig-tweak --file $nuttx/.config --enable CONFIG_WINDOWS_CYGWIN
kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_UBUNTU
kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_NATIVE
else
kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_CYGWIN
if [ "X$wenv" == "Xubuntu" ]; then
echo " Select CONFIG_WINDOWS_UBUNTU=y"
kconfig-tweak --file $nuttx/.config --enable CONFIG_WINDOWS_UBUNTU
kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_NATIVE
else
echo " Select CONFIG_WINDOWS_NATIVE=y"
kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_UBUNTU
kconfig-tweak --file $nuttx/.config --enable CONFIG_WINDOWS_NATIVE
fi
fi
kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_MSYS
kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_OTHER
kconfig-tweak --file $nuttx/.config --enable CONFIG_SIM_X8664_MICROSOFT
kconfig-tweak --file $nuttx/.config --disable CONFIG_SIM_X8664_SYSTEMV
kconfig-tweak --file $nuttx/.config --disable CONFIG_SIM_M32
fi fi
kconfig-tweak --file $nuttx/.config --disable CONFIG_HOST_MACOS kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_MSYS
kconfig-tweak --file $nuttx/.config --disable CONFIG_HOST_OTHER kconfig-tweak --file $nuttx/.config --disable CONFIG_WINDOWS_OTHER
if [ "X$sizet" == "Xlong" ]; then kconfig-tweak --file $nuttx/.config --enable CONFIG_SIM_X8664_MICROSOFT
echo " Select CONFIG_CXX_NEWLONG=y" kconfig-tweak --file $nuttx/.config --disable CONFIG_SIM_X8664_SYSTEMV
kconfig-tweak --file $nuttx/.config --enable CONFIG_CXX_NEWLONG kconfig-tweak --file $nuttx/.config --disable CONFIG_SIM_M32
else fi
echo " Disable CONFIG_CXX_NEWLONG"
kconfig-tweak --file $nuttx/.config --disable CONFIG_CXX_NEWLONG kconfig-tweak --file $nuttx/.config --disable CONFIG_HOST_MACOS
kconfig-tweak --file $nuttx/.config --disable CONFIG_HOST_OTHER
if [ "X$sizet" == "Xlong" ]; then
echo " Select CONFIG_CXX_NEWLONG=y"
kconfig-tweak --file $nuttx/.config --enable CONFIG_CXX_NEWLONG
else
echo " Disable CONFIG_CXX_NEWLONG"
kconfig-tweak --file $nuttx/.config --disable CONFIG_CXX_NEWLONG
fi
if [ "X$toolchain" != "X" ]; then
setting=`grep TOOLCHAIN $nuttx/.config | grep -v CONFIG_ARCH_TOOLCHAIN_GNU=y | grep =y`
varname=`echo $setting | cut -d'=' -f1`
if [ ! -z "$varname" ]; then
echo " Disabling $varname"
kconfig-tweak --file $nuttx/.config --disable $varname
fi fi
if [ "X$toolchain" != "X" ]; then echo " Enabling $toolchain"
setting=`grep TOOLCHAIN $nuttx/.config | grep -v CONFIG_ARCH_TOOLCHAIN_GNU=y | grep =y` kconfig-tweak --file $nuttx/.config --enable $toolchain
varname=`echo $setting | cut -d'=' -f1` fi
if [ ! -z "$varname" ]; then
echo " Disabling $varname"
kconfig-tweak --file $nuttx/.config --disable $varname
fi
echo " Enabling $toolchain" echo " Refreshing..."
kconfig-tweak --file $nuttx/.config --enable $toolchain cd $nuttx || { echo "ERROR: failed to CD to $nuttx"; exit 1; }
fi ${MAKE} ${MAKE_FLAGS} olddefconfig 1>/dev/null 2>&1
echo " Refreshing..."
cd $nuttx || { echo "ERROR: failed to CD to $nuttx"; exit 1; }
${MAKE} ${MAKE_FLAGS} olddefconfig 1>/dev/null 2>&1
} }
# Perform the next build # Perform the next build
function build { function build {
cd $nuttx || { echo "ERROR: failed to CD to $nuttx"; exit 1; } cd $nuttx || { echo "ERROR: failed to CD to $nuttx"; exit 1; }
echo " Building NuttX..." echo " Building NuttX..."
echo "------------------------------------------------------------------------------------" echo "------------------------------------------------------------------------------------"
${MAKE} ${JOPTION} ${MAKE_FLAGS} 1>/dev/null ${MAKE} ${JOPTION} ${MAKE_FLAGS} 1>/dev/null
} }
# Coordinate the steps for the next build test # Coordinate the steps for the next build test
function dotest { function dotest {
echo "------------------------------------------------------------------------------------" echo "------------------------------------------------------------------------------------"
distclean distclean
configure configure
build build
} }
# Perform the build test for each entry in the test list file # Perform the build test for each entry in the test list file
@@ -273,72 +273,72 @@ testlist=`cat $testfile`
#while read -r line || [[ -n $line ]]; do #while read -r line || [[ -n $line ]]; do
for line in $testlist; do for line in $testlist; do
echo "====================================================================================" echo "===================================================================================="
firstch=${line:0:1} firstch=${line:0:1}
if [ "X$firstch" == "X#" ]; then if [ "X$firstch" == "X#" ]; then
echo "Skipping: $line" echo "Skipping: $line"
else else
echo "Configuration/Tool: $line" echo "Configuration/Tool: $line"
# Parse the next line # Parse the next line
config=`echo $line | cut -d',' -f1` config=`echo $line | cut -d',' -f1`
configdir=`echo $config | cut -s -d':' -f2` configdir=`echo $config | cut -s -d':' -f2`
if [ -z "${configdir}" ]; then
configdir=`echo $config | cut -s -d'/' -f2`
if [ -z "${configdir}" ]; then if [ -z "${configdir}" ]; then
configdir=`echo $config | cut -s -d'/' -f2` echo "ERROR: Malformed configuration: ${config}"
if [ -z "${configdir}" ]; then
echo "ERROR: Malformed configuration: ${config}"
showusage
else
boarddir=`echo $config | cut -d'/' -f1`
fi
else
boarddir=`echo $config | cut -d':' -f1`
fi
# Detect the architecture of this board.
ARCHLIST="arm avr hc mips misoc or1k renesas risc-v sim x86 xtensa z16 z80"
CHIPLIST="a1x am335x c5471 cxd56xx dm320 efm32 imx6 imxrt kinetis kl lc823450
lpc17xx_40xx lpc214x lpc2378 lpc31xx lpc43xx lpc54xx max326xx moxart nrf52
nuc1xx rx65n s32k1xx sam34 sama5 samd2l2 samd5e5 samv7 stm32 stm32f0l0g0 stm32f7 stm32h7
stm32l4 str71x tiva tms570 xmc4 at32uc3 at90usb atmega mcs92s12ne64 pic32mx
pic32mz lm32 mor1kx m32262f8 sh7032 fe310 k210 gap8 nr5m100 sim qemu esp32 z16f2811
ez80 z180 z8 z80"
for arch in ${ARCHLIST}; do
for chip in ${CHIPLIST}; do
if [ -f ${nuttx}/boards/${arch}/${chip}/${boarddir}/Kconfig ]; then
archdir=${arch}
chipdir=${chip}
fi
done
done
if [ -z "${archdir}" ]; then
echo "ERROR: Architecture of ${boarddir} not found"
exit 1
fi
path=$nuttx/boards/$archdir/$chipdir/$boarddir/configs/$configdir
if [ ! -r "$path/defconfig" ]; then
echo "ERROR: no configuration found at $path"
showusage showusage
else
boarddir=`echo $config | cut -d'/' -f1`
fi fi
else
unset toolchain; boarddir=`echo $config | cut -d':' -f1`
if [ "X$config" != "X$line" ]; then
toolchain=`echo $line | cut -d',' -f2`
if [ -z "$toolchain" ]; then
echo " Warning: no tool configuration"
fi
fi
# Perform the build test
dotest
fi fi
cd $WD || { echo "ERROR: Failed to CD to $WD"; exit 1; }
# Detect the architecture of this board.
ARCHLIST="arm avr hc mips misoc or1k renesas risc-v sim x86 xtensa z16 z80"
CHIPLIST="a1x am335x c5471 cxd56xx dm320 efm32 imx6 imxrt kinetis kl lc823450
lpc17xx_40xx lpc214x lpc2378 lpc31xx lpc43xx lpc54xx max326xx moxart nrf52
nuc1xx rx65n s32k1xx sam34 sama5 samd2l2 samd5e5 samv7 stm32 stm32f0l0g0 stm32f7 stm32h7
stm32l4 str71x tiva tms570 xmc4 at32uc3 at90usb atmega mcs92s12ne64 pic32mx
pic32mz lm32 mor1kx m32262f8 sh7032 fe310 k210 gap8 nr5m100 sim qemu esp32 z16f2811
ez80 z180 z8 z80"
for arch in ${ARCHLIST}; do
for chip in ${CHIPLIST}; do
if [ -f ${nuttx}/boards/${arch}/${chip}/${boarddir}/Kconfig ]; then
archdir=${arch}
chipdir=${chip}
fi
done
done
if [ -z "${archdir}" ]; then
echo "ERROR: Architecture of ${boarddir} not found"
exit 1
fi
path=$nuttx/boards/$archdir/$chipdir/$boarddir/configs/$configdir
if [ ! -r "$path/defconfig" ]; then
echo "ERROR: no configuration found at $path"
showusage
fi
unset toolchain;
if [ "X$config" != "X$line" ]; then
toolchain=`echo $line | cut -d',' -f2`
if [ -z "$toolchain" ]; then
echo " Warning: no tool configuration"
fi
fi
# Perform the build test
dotest
fi
cd $WD || { echo "ERROR: Failed to CD to $WD"; exit 1; }
done # < $testfile done # < $testfile
echo "====================================================================================" echo "===================================================================================="
+1 -1
View File
@@ -69,6 +69,6 @@ echo Missing Argument
:ShowUsage :ShowUsage
echo USAGE: %0 ^<link^> echo USAGE: %0 ^<link^>
echo Where: echo Where:
echo ^<link^> is the linked (or copied) directory to be removed echo ^<link^> is the linked (or copied) directory to be removed
:End :End
+17 -17
View File
@@ -39,32 +39,32 @@ link=$1
# Verify that arguments were provided # Verify that arguments were provided
if [ -z "${link}" ]; then if [ -z "${link}" ]; then
echo "Missing link argument" echo "Missing link argument"
exit 1 exit 1
fi fi
# Check if something already exists at the link path # Check if something already exists at the link path
if [ -e "${link}" ]; then if [ -e "${link}" ]; then
# Yes, is it a symbolic link? If so, then remove it # Yes, is it a symbolic link? If so, then remove it
if [ -h "${link}" ]; then if [ -h "${link}" ]; then
rm -f "${link}" rm -f "${link}"
else else
# If the path is a directory and contains the "fake link" mark, then # If the path is a directory and contains the "fake link" mark, then
# treat it like a soft link (i.e., remove the directory) # treat it like a soft link (i.e., remove the directory)
if [ -d "${link}" -a -f "${link}/.fakelnk" ]; then if [ -d "${link}" -a -f "${link}/.fakelnk" ]; then
rm -rf "${link}" rm -rf "${link}"
else else
# It is something else (like a file) or directory that does # It is something else (like a file) or directory that does
# not contain the "fake link" mark # not contain the "fake link" mark
echo "${link} already exists but is not a symbolic link" echo "${link} already exists but is not a symbolic link"
exit 1 exit 1
fi fi
fi fi
fi fi
+58 -58
View File
@@ -44,89 +44,89 @@ unset BUILD
unset OUTFILE unset OUTFILE
while [ ! -z "$1" ]; do while [ ! -z "$1" ]; do
case $1 in case $1 in
-b ) -b )
shift shift
BUILD=$1 BUILD=$1
;; ;;
-d ) -d )
set -x set -x
;; ;;
-v ) -v )
shift shift
VERSION=$1 VERSION=$1
;; ;;
-h ) -h )
echo "$0 is a tool for generation of proper version files for the NuttX build" echo "$0 is a tool for generation of proper version files for the NuttX build"
echo "" echo ""
echo $USAGE echo $USAGE
echo "" echo ""
echo "Where:" echo "Where:"
echo " -b <build>" echo " -b <build>"
echo " Use this build identification string. Default: use GIT build ID" echo " Use this build identification string. Default: use GIT build ID"
echo " NOTE: GIT build information may not be available in a snapshot" echo " NOTE: GIT build information may not be available in a snapshot"
echo " -d" echo " -d"
echo " Enable script debug" echo " Enable script debug"
echo " -h" echo " -h"
echo " show this help message and exit" echo " show this help message and exit"
echo " -v <major.minor>" echo " -v <major.minor>"
echo " The NuttX version number expressed as a major and minor number separated" echo " The NuttX version number expressed as a major and minor number separated"
echo " by a period" echo " by a period"
echo " <outfile-path>" echo " <outfile-path>"
echo " The full path to the version file to be created" echo " The full path to the version file to be created"
exit 0 exit 0
;; ;;
* ) * )
break; break;
;; ;;
esac esac
shift shift
done done
OUTFILE=$1 OUTFILE=$1
if [ -z ${VERSION} ] ; then if [ -z ${VERSION} ] ; then
VERSION=`git tag --sort=taggerdate | tail -1 | cut -d'-' -f2` VERSION=`git tag --sort=taggerdate | tail -1 | cut -d'-' -f2`
fi fi
# Make sure we know what is going on # Make sure we know what is going on
if [ -z ${VERSION} ] ; then if [ -z ${VERSION} ] ; then
echo "Missing versioning information" echo "Missing versioning information"
echo $USAGE echo $USAGE
echo $ADVICE echo $ADVICE
exit 1 exit 1
fi fi
if [ -z ${OUTFILE} ] ; then if [ -z ${OUTFILE} ] ; then
echo "Missing path to the output file" echo "Missing path to the output file"
echo $USAGE echo $USAGE
echo $ADVICE echo $ADVICE
exit 1 exit 1
fi fi
# Get the major and minor version numbers # Get the major and minor version numbers
MAJOR=`echo ${VERSION} | cut -d'.' -f1` MAJOR=`echo ${VERSION} | cut -d'.' -f1`
if [ "X${MAJOR}" = "X${VERSION}" ]; then if [ "X${MAJOR}" = "X${VERSION}" ]; then
echo "Missing minor version number" echo "Missing minor version number"
echo $USAGE echo $USAGE
echo $ADVICE echo $ADVICE
exit 2 exit 2
fi fi
MINOR=`echo ${VERSION} | cut -d'.' -f2` MINOR=`echo ${VERSION} | cut -d'.' -f2`
# Get GIT information (if not provided on the command line) # Get GIT information (if not provided on the command line)
if [ -z "${BUILD}" ]; then if [ -z "${BUILD}" ]; then
BUILD=`git log --oneline -1 | cut -d' ' -f1 2>/dev/null` BUILD=`git log --oneline -1 | cut -d' ' -f1 2>/dev/null`
if [ -z "${BUILD}" ]; then if [ -z "${BUILD}" ]; then
echo "GIT version information is not available" echo "GIT version information is not available"
exit 3 exit 3
fi fi
if [ -n "`git diff-index --name-only HEAD | head -1`" ]; then if [ -n "`git diff-index --name-only HEAD | head -1`" ]; then
BUILD=${BUILD}-dirty BUILD=${BUILD}-dirty
fi fi
fi fi
# Write a version file into the NuttX directoy. The syntax of file is such that it # Write a version file into the NuttX directoy. The syntax of file is such that it
+75 -76
View File
@@ -50,38 +50,38 @@ unset BUILD
unset DEBUG unset DEBUG
while [ ! -z "$1" ]; do while [ ! -z "$1" ]; do
case $1 in case $1 in
-b ) -b )
shift
BUILD="-b ${1}"
;;
-d )
set -x
DEBUG=-d
;;
-h )
echo "$0 is a tool for generation of release versions of NuttX"
echo ""
echo $USAGE
echo ""
echo "Where:"
echo " -b <build>"
echo " Use this build identification string. Default: use GIT build ID"
echo " NOTE: GIT build information may not be available in a snapshot"
echo " -d"
echo " Enable script debug"
echo " -h"
echo " show this help message and exit"
echo " <major.minor>"
echo " The NuttX version number expressed as a major and minor number separated"
echo " by a period"
exit 0
;;
* )
break;
;;
esac
shift shift
BUILD="-b ${1}"
;;
-d )
set -x
DEBUG=-d
;;
-h )
echo "$0 is a tool for generation of release versions of NuttX"
echo ""
echo $USAGE
echo ""
echo "Where:"
echo " -b <build>"
echo " Use this build identification string. Default: use GIT build ID"
echo " NOTE: GIT build information may not be available in a snapshot"
echo " -d"
echo " Enable script debug"
echo " -h"
echo " show this help message and exit"
echo " <major.minor>"
echo " The NuttX version number expressed as a major and minor number separated"
echo " by a period"
exit 0
;;
* )
break;
;;
esac
shift
done done
# The last thing on the command line is the version number # The last thing on the command line is the version number
@@ -92,21 +92,21 @@ VERSIONOPT="-v ${VERSION}"
# Make sure we know what is going on # Make sure we know what is going on
if [ -z ${VERSION} ] ; then if [ -z ${VERSION} ] ; then
echo "You must supply a version like xx.yy as a parameter" echo "You must supply a version like xx.yy as a parameter"
echo $USAGE echo $USAGE
echo $ADVICE echo $ADVICE
exit 1; exit 1;
fi fi
if [ -z "${BUILD}" ]; then if [ -z "${BUILD}" ]; then
GITINFO=`git log 2>/dev/null | head -1` GITINFO=`git log 2>/dev/null | head -1`
if [ -z "${GITINFO}" ]; then if [ -z "${GITINFO}" ]; then
echo "GIT version information is not available. Use the -b option" echo "GIT version information is not available. Use the -b option"
echo $USAGE echo $USAGE
echo $ADVICE echo $ADVICE
exit 1; exit 1;
fi fi
echo "GIT: ${GITINFO}" echo "GIT: ${GITINFO}"
fi fi
@@ -116,18 +116,18 @@ fi
MYNAME=`basename $0` MYNAME=`basename $0`
if [ -x ${WD}/${MYNAME} ] ; then if [ -x ${WD}/${MYNAME} ] ; then
TRUNKDIR="${WD}/../.." TRUNKDIR="${WD}/../.."
else else
if [ -x ${WD}/tools/${MYNAME} ] ; then if [ -x ${WD}/tools/${MYNAME} ] ; then
TRUNKDIR="${WD}/.." TRUNKDIR="${WD}/.."
else else
if [ -x ${WD}/nuttx-${VERSION}/tools/${MYNAME} ] ; then if [ -x ${WD}/nuttx-${VERSION}/tools/${MYNAME} ] ; then
TRUNKDIR="${WD}" TRUNKDIR="${WD}"
else else
echo "You must cd into the NUTTX directory to execute this script." echo "You must cd into the NUTTX directory to execute this script."
exit 1 exit 1
fi fi
fi fi
fi fi
# Get the NuttX directory names and the path to the parent directory # Get the NuttX directory names and the path to the parent directory
@@ -138,21 +138,21 @@ APPDIR=${TRUNKDIR}/apps-${VERSION}
# Make sure that the versioned directory exists # Make sure that the versioned directory exists
if [ ! -d ${TRUNKDIR} ]; then if [ ! -d ${TRUNKDIR} ]; then
echo "Directory ${TRUNKDIR} does not exist" echo "Directory ${TRUNKDIR} does not exist"
exit 1 exit 1
fi fi
cd ${TRUNKDIR} || \ cd ${TRUNKDIR} || \
{ echo "Failed to cd to ${TRUNKDIR}" ; exit 1 ; } { echo "Failed to cd to ${TRUNKDIR}" ; exit 1 ; }
if [ ! -d nuttx-${VERSION} ] ; then if [ ! -d nuttx-${VERSION} ] ; then
echo "Directory ${TRUNKDIR}/nuttx-${VERSION} does not exist!" echo "Directory ${TRUNKDIR}/nuttx-${VERSION} does not exist!"
exit 1 exit 1
fi fi
if [ ! -d apps-${VERSION} ] ; then if [ ! -d apps-${VERSION} ] ; then
echo "Directory ${TRUNKDIR}/apps-${VERSION} does not exist!" echo "Directory ${TRUNKDIR}/apps-${VERSION} does not exist!"
exit 1 exit 1
fi fi
# Create the versioned tarball names # Create the versioned tarball names
@@ -179,8 +179,8 @@ cd ${NUTTX}/Documentation || \
VERSIONSH=${NUTTX}/tools/version.sh VERSIONSH=${NUTTX}/tools/version.sh
if [ ! -x "${VERSIONSH}" ]; then if [ ! -x "${VERSIONSH}" ]; then
echo "No executable script was found at: ${VERSIONSH}" echo "No executable script was found at: ${VERSIONSH}"
exit 1 exit 1
fi fi
${VERSIONSH} ${DEBUG} ${BUILD} ${VERSIONOPT} ${NUTTX}/.version || \ ${VERSIONSH} ${DEBUG} ${BUILD} ${VERSIONOPT} ${NUTTX}/.version || \
@@ -216,27 +216,27 @@ make -C ${NUTTX} distclean
# Remove any previous tarballs # Remove any previous tarballs
if [ -f ${NUTTX_TARNAME} ] ; then if [ -f ${NUTTX_TARNAME} ] ; then
echo "Removing ${TRUNKDIR}/${NUTTX_TARNAME}" echo "Removing ${TRUNKDIR}/${NUTTX_TARNAME}"
rm -f ${NUTTX_TARNAME} || \ rm -f ${NUTTX_TARNAME} || \
{ echo "rm ${NUTTX_TARNAME} failed!" ; exit 1 ; } { echo "rm ${NUTTX_TARNAME} failed!" ; exit 1 ; }
fi fi
if [ -f ${NUTTX_ZIPNAME} ] ; then if [ -f ${NUTTX_ZIPNAME} ] ; then
echo "Removing ${TRUNKDIR}/${NUTTX_ZIPNAME}" echo "Removing ${TRUNKDIR}/${NUTTX_ZIPNAME}"
rm -f ${NUTTX_ZIPNAME} || \ rm -f ${NUTTX_ZIPNAME} || \
{ echo "rm ${NUTTX_ZIPNAME} failed!" ; exit 1 ; } { echo "rm ${NUTTX_ZIPNAME} failed!" ; exit 1 ; }
fi fi
if [ -f ${APPS_TARNAME} ] ; then if [ -f ${APPS_TARNAME} ] ; then
echo "Removing ${TRUNKDIR}/${APPS_TARNAME}" echo "Removing ${TRUNKDIR}/${APPS_TARNAME}"
rm -f ${APPS_TARNAME} || \ rm -f ${APPS_TARNAME} || \
{ echo "rm ${APPS_TARNAME} failed!" ; exit 1 ; } { echo "rm ${APPS_TARNAME} failed!" ; exit 1 ; }
fi fi
if [ -f ${APPS_ZIPNAME} ] ; then if [ -f ${APPS_ZIPNAME} ] ; then
echo "Removing ${TRUNKDIR}/${APPS_ZIPNAME}" echo "Removing ${TRUNKDIR}/${APPS_ZIPNAME}"
rm -f ${APPS_ZIPNAME} || \ rm -f ${APPS_ZIPNAME} || \
{ echo "rm ${APPS_ZIPNAME} failed!" ; exit 1 ; } { echo "rm ${APPS_ZIPNAME} failed!" ; exit 1 ; }
fi fi
# Then tar and zip-up the directories # Then tar and zip-up the directories
@@ -255,4 +255,3 @@ ${ZIP} ${APPS_TARNAME} || \
{ echo "zip of ${APPS_TARNAME} failed!" ; exit 1 ; } { echo "zip of ${APPS_TARNAME} failed!" ; exit 1 ; }
cd ${NUTTX} cd ${NUTTX}