summaryrefslogtreecommitdiff
path: root/nuttx/tools/mkdeps.sh
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2013-09-29 11:46:10 -0600
committerGregory Nutt <gnutt@nuttx.org>2013-09-29 11:46:10 -0600
commitbcfbb7a3974dbd00ffb99d146e69eb3e3dc99d57 (patch)
treea1d7ed3a7b884b53d54f02ec23c6139dd7bd8d0f /nuttx/tools/mkdeps.sh
parent4c24c7c4a741eaeffc76339f07076cdad7a36c56 (diff)
downloadnuttx-bcfbb7a3974dbd00ffb99d146e69eb3e3dc99d57.tar.gz
nuttx-bcfbb7a3974dbd00ffb99d146e69eb3e3dc99d57.tar.bz2
nuttx-bcfbb7a3974dbd00ffb99d146e69eb3e3dc99d57.zip
Dependency generation fix for directories that keep object files in a sub-directory
Diffstat (limited to 'nuttx/tools/mkdeps.sh')
-rwxr-xr-xnuttx/tools/mkdeps.sh28
1 files changed, 25 insertions, 3 deletions
diff --git a/nuttx/tools/mkdeps.sh b/nuttx/tools/mkdeps.sh
index 028fd1d9f..14ac6080e 100755
--- a/nuttx/tools/mkdeps.sh
+++ b/nuttx/tools/mkdeps.sh
@@ -2,7 +2,7 @@
############################################################################
# tools/mkdeps.sh
#
-# Copyright (C) 2007-2009, 2011-2012 Gregory Nutt. All rights reserved.
+# 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
@@ -33,7 +33,6 @@
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
-
#
# Usage:
@@ -58,6 +57,12 @@ show_usage ()
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"
@@ -91,7 +96,14 @@ dodep ()
fi
fi
- $cc -M $cflags $fullpath || \
+ 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; )
}
@@ -100,6 +112,8 @@ unset cflags
unset files
unset args
unset altpath
+unset objpath
+suffix=.o
winpaths=n
unset topdir
@@ -127,6 +141,14 @@ while [ ! -z "$1" ]; do
args="$args $1"
fi
;;
+ --obj-path )
+ shift
+ objpath="$1"
+ ;;
+ --obj-suffix )
+ shift
+ suffix="$1"
+ ;;
--winpaths )
if [ -z "$args" ]; then
shift