mkdeps.sh and mkdeps.bat have been deleted. All configurations must now use the compiler mkeps program

This commit is contained in:
Gregory Nutt 2016-01-09 16:07:12 -06:00
parent fbb4dcc0af
commit 468732e064
7 changed files with 9 additions and 444 deletions

View File

@ -11292,4 +11292,7 @@
(2016-01-09).
* arch/avr/include/debug.h: Add an AVR-specific header file used when
the AVR MEMX pointer is used. From Dimitri Kloper (2016-01-09).
* tools/mkdeps.c: Deleted mkdeps.sh and mkdeps.bat. The mkdeps
executable generated from mkdeps.c is now that the only supported
way to make dependencies (2016-01-09).

@ -1 +1 @@
Subproject commit 4217e1a644a0dfe8f111ab07f9df38af2ea906d7
Subproject commit 8830f8f6387b287a480b849e02569b881e5cd413

2
arch

@ -1 +1 @@
Subproject commit 3fbe4f51dc531070c93821018a342cfb5d8a6c02
Subproject commit 4570fe271a034ae7aa23e579064f90c75594f985

@ -1 +1 @@
Subproject commit a8e9be00f98fe4abe13ad2703637f00c516d7d7d
Subproject commit 57c7e67c4d5374ed87a94091deee8ae65eccde64

View File

@ -393,18 +393,15 @@ mkromfsimg.sh
image. It accepts an rcS script "template" and generates and image that
may be mounted under /etc in the NuttX pseudo file system.
mkdeps.sh
mkdeps.bat
mkdeps.c
mknulldeps.sh
-------------
NuttX uses the GCC compilers capabilities to create Makefile dependencies.
The bash script mkdeps.sh is used to run GCC in order to create the
dependencies. If a NuttX configuration uses the GCC toolchain, its Make.defs
file (see configs/README.txt) will include a line like:
The program mkdeps is used to run GCC in order to create the dependencies.
If a NuttX configuration uses the GCC toolchain, its Make.defs file (see
configs/README.txt) will include a line like:
MKDEP = $(TOPDIR)/tools/mkdeps.sh, or
MKDEP = $(TOPDIR)/tools/mkdeps[.exe] (See NOTE below)
If the NuttX configuration does not use a GCC compatible toolchain, then
@ -414,23 +411,6 @@ mknulldeps.sh
The mknulldeps.sh is a stub script that does essentially nothing.
NOTE: The mk*deps.* files are undergoing change. mkdeps.sh is a bash
script that produces dependencies well for POSIX style hosts (e..g.,
Linux and Cygwin). It does not work well for mixed environments with
a Windows toolchain running in a POSIX style environment (hence, the
mknulldeps.sh script). And, of course, cannot be used in a Windows
nativ environment.
[mkdeps.sh does have an option, --winpath, that purports to convert
the dependencies generated by a Windows toolchain to POSIX format.
However, that is not being used and mostly likely does not cover
all of the conversion cases.]
mkdeps.bat is a simple port of the bash script to run in a Windows
command shell. However, it does not work well either because some
of the common CFLAGS use characters like '=' which are transformed
by the CMD.exe shell.
mkdeps.c generates mkdeps (on Linux) or mkdeps.exe (on Windows).
However, this verison is still under-development. It works well in
the all POSIX environment or in the all Windows environment but also

View File

@ -1,200 +0,0 @@
@echo off
rem tools/mkdeps.sh
rem
rem Copyright (C) 2012 Gregory Nutt. All rights reserved.
rem Author: Gregory Nutt <gnutt@nuttx.org>
rem
rem Redistribution and use in source and binary forms, with or without
rem modification, are permitted provided that the following conditions
rem are met:
rem
rem 1. Redistributions of source code must retain the above copyright
rem notice, this list of conditions and the following disclaimer.
rem 2. Redistributions in binary form must reproduce the above copyright
rem notice, this list of conditions and the following disclaimer in
rem the documentation and/or other materials provided with the
rem distribution.
rem 3. Neither the name NuttX nor the names of its contributors may be
rem used to endorse or promote products derived from this software
rem without specific prior written permission.
rem
rem THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
rem "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
rem LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
rem FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
rem COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
rem INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
rem BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
rem OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
rem AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
rem LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
rem ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
rem POSSIBILITY OF SUCH DAMAGE.
rem Accumulate CFLAGS up to "--"
set cc=
set cflags=
set altpath=
set files=
set args=
set objpath=
set suffix=.o
set debug=n
:Loop
if "%1"=="" goto Continue
if "%1"=="--" (
set cc=%cflags%
set cflags=%args%
set args=
goto NextParm
)
if "%1"=="--dep-path" (
if "%args%"=="" (
set altpath=%altpath% %2
) else (
set args=%args% %2
)
shift
goto NextParm
)
if "%1"=="--obj-path" (
set objpath=%2
shift
goto NextParm
)
if "%1"=="--obj-suffix" (
set suffix=%2
shift
goto NextParm
)
if "%1"=="--dep-debug" (
rem @echo on
set debug=y
goto NextParm
)
if "%1"=="--help" goto Usage
if "%args%"=="" (
set args=%1
) else (
set args=%args% %1
)
:NextParm
shift
goto Loop
:Continue
set files=%args%
if "%debug%"=="y" (
echo cc=%cc%
echo cflags=%cflags%
echo files=%files%
echo altpath=%altpath%
)
rem Now check if we have everything
if "%cc%"=="" (
echo ERROR: No compiler specified
goto Usage
)
if "%files%"=="" (
rem Don't report an error -- this happens normally in some configurations
echo # No files specified for dependency generataion
goto End
)
rem Then get the dependencies for each file
if "%altpath%"=="" goto NoPaths
for %%G in (%files%) do (
set fullpath=
set file=%%G
call :Checkpaths
if "%debug%"=="y" echo %file%: fullpath=%fullpath%
if "%fullpath%"=="" goto :NoFile
mtarg=""
if "%objpath%"=="" (
set objname=%~n1
set mtarg="-MT %objpath%\%objname%%suffix%
)
if "%debug%"=="y" echo CMD: %cc% -M %cflags% %fullpath%
%cc% -M %mtarg% %cflags% %fullpath% || goto DepFail
)
goto :End
:NoPaths
for %%G in (%files%) do (
set fullpath=
set file=%%G
call :CheckFile %%G
)
goto :End
:CheckFile
if "%debug%"=="y" echo Checkfile: Checking %file%
if not exist %file% goto :NoFile
set fullpath=%file%
if "%debug%"=="y" echo CMD: %cc% -M %cflags% %fullpath%
%cc% -M %cflags% %fullpath% || goto DepFail
goto :EOF
:CheckPaths
for %%H in (%altpath%) do (
set tmppath=%%H\%file%
if "%debug%"=="y" echo Checkfile: Checking %tmppath%
if exist %tmppath% (
set fullpath=%tmppath%
goto :EOF
)
)
goto :EOF
:NoFile
echo ERROR: No readable file at %file%
goto Usage
:DepFail
echo ERROR: Failed to created dependencies for %file%
:Usage
echo Usage: mkdeps [OPTIONS] CC -- CFLAGS -- file [file [file...]]
echo Where:
echo CC
echo A variable number of arguments that define how to execute the compiler
echo CFLAGS
echo The compiler compilation flags
echo file
echo One or more C files whose dependencies will be checked. Each file is expected
echo to reside in the current directory unless --dep-path is provided on the command line
echo And [OPTIONS] include:
echo --dep-debug
echo Enable script debug
echo --dep-path ^<path^>
echo Do not look in the current directory for the file. Instead, look in <path> to see
echo if the file resides there. --dep-path may be used multiple times to specify
echo multiple alternative location
echo --obj-path ^<path^>
echo The final objects will not reside in this path but, rather, at the path provided by
echo ^<path^>. if provided multiple time, only the last --obj-path will be used.
echo --obj-suffix ^<suffix^>
echo If and object path is provided, then the extension will be assumed to be .o. This
echo default suffix can be overrided with this command line option.
echo --help
echo Shows this message and exits
:End

View File

@ -1,218 +0,0 @@
#!/bin/bash
############################################################################
# tools/mkdeps.sh
#
# Copyright (C) 2007-2009, 2011-2013 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name NuttX nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
#
# Usage:
show_usage ()
{
echo ""
echo "$progname [OPTIONS] CC -- CFLAGS -- file [file [file...]]"
echo ""
echo "Where:"
echo " CC"
echo " A variable number of arguments that define how to execute the compiler"
echo " CFLAGS"
echo " The compiler compilation flags"
echo " file"
echo " One or more C files whose dependencies will be checked. Each file is expected"
echo " to reside in the current directory unless --dep-path is provided on the command line"
echo ""
echo "And [OPTIONS] include:"
echo " --dep-debug"
echo " Enable script debug"
echo " --dep-path <path>"
echo " Do not look in the current directory for the file. Instead, look in <path> to see"
echo " if the file resides there. --dep-path may be used multiple times to specify"
echo " multiple alternative location"
echo " --obj-path <path>"
echo " The final objects will not reside in this path but, rather, at the path provided by"
echo " <path>. if provided multiple time, only the last --obj-path will be used."
echo " --obj-suffix <suffix>"
echo " If and object path is provided, then the extension will be assumed to be .o. This"
echo " default suffix can be overrided with this command line option."
echo " --winpaths <TOPDIR>"
echo " CC generates dependency lists using Windows paths (e.g., C:\blablah\blabla). This"
echo " switch instructs the script to use 'cygpath' to convert the Windows paths to Cygwin"
echo " paths"
echo " --help"
echo " Shows this message and exits"
exit 1
}
dodep ()
{
unset fullpath
if [ -z "$altpath" ]; then
if [ -r $1 ]; then
fullpath=$1
else
echo "# ERROR: No readable file at $1"
show_usage
fi
else
for path in $altpath; do
tmppath=$path/$1
if [ -r $tmppath ]; then
fullpath=$tmppath
break;
fi
done
if [ -z "$fullpath" ]; then
echo "# ERROR: No readable file for $1 found at any location"
show_usage
fi
fi
unset mtarg
if [ ! -z "$objpath" ]; then
srcname=`basename $1`
objname="${srcname%.*}"
mtarg="-MT ${objpath}/${objname}${suffix}"
fi
$cc -M $mtarg $cflags $fullpath || \
( echo "# ERROR: $cc -M $cflags $fullpath FAILED"; exit 4; )
}
unset cc
unset cflags
unset files
unset args
unset altpath
unset objpath
suffix=.o
winpaths=n
unset topdir
# Accumulate CFLAGS up to "--"
progname=$0
while [ ! -z "$1" ]; do
case $1 in
-- )
cc=$cflags
cflags=$args
args=
;;
--dep-debug )
if [ -z "$args" ]; then
set -x
else
args="$args $1"
fi
;;
--dep-path )
if [ -z "$args" ]; then
shift
altpath="$altpath $1"
else
args="$args $1"
fi
;;
--obj-path )
shift
objpath="$1"
;;
--obj-suffix )
shift
suffix="$1"
;;
--winpaths )
if [ -z "$args" ]; then
shift
winpaths=y
topdir=$1
else
args="$args $1"
fi
;;
--help )
show_usage
;;
*)
args="$args $1"
;;
esac
shift
done
files=$args
if [ -z "$cc" ]; then
echo "ERROR: No compiler specified"
show_usage
exit 1
fi
if [ -z "$files" ]; then
# Don't report an error -- this happens normally in some configurations
echo "# No files specified for dependency generataion"
exit 0
fi
# Check if this compiler generates Cygwin/Linux paths or Windows paths
if [ "X${winpaths}" = "Xy" ]; then
# We will have to parse and modify each dependency (yech)
# Make sure a valid TOPDIR argument was provided
if [ -z "$topdir" -o ! -d $topdir ]; then
echo "<TOPDIR> not specified or does not exist: $topdir"
show_usage
exit 1
fi
# Get the top dir expressed like the Windows GCC would use it, except
# with forward slashs
wtopdir=`cygpath -w ${topdir} | sed -e "s,\\\\\\,/,g"`
# Then get the dependency and perform conversions on it to make it
# palatable to the Cygwin make. This is probably not sufficiently
# general to work on all platforms (like if your disk is not C:).
for file in $files ; do
dodep $file | sed -e "s,\\\,/,g" -e "s,${wtopdir},${topdir},g" \
-e "s,/ ,\\\ ,g" -e "s,c:/,/cygdrive/c/,g" \
-e "s,/$,\\\,g"
done
else
# For normal Cygwin/Linux GCC, the dependency paths are in the
# correct form and can simply be echoed on stdout
for file in $files ; do
dodep $file
done
fi