[PATCH 09] bootstrap: handy --root switch for bootstrapping subdirs

Daniel Hellstrom daniel at gaisler.com
Thu Feb 2 14:46:30 UTC 2012


Use the "--root DIR" to process only a subdir, for example
 $ ./bootstrap --root c/src/lib/libbsp/sparc
will only generate Makefiles for all SPARC BSPs, saves some
time when working with a specific BSP.

Signed-off-by: Daniel Hellstrom <daniel at gaisler.com>
---
 bootstrap |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/bootstrap b/bootstrap
index 1a2a424..472416d 100755
--- a/bootstrap
+++ b/bootstrap
@@ -18,6 +18,7 @@ top_srcdir=`dirname $0`
 verbose="";
 quiet="false"
 mode="autoreconf"
+root=.
 
 usage()
 {
@@ -92,6 +93,9 @@ case $1 in
 -g|--ge|--gen|--gene|--gener|--genera|--generat|--generate)
   mode="generate";
   shift;;
+--root)
+  root=$2;
+  shift 2;;
 -*) echo "unknown option $1" ;
   usage ;;
 *) echo "invalid parameter $1" ;
@@ -101,7 +105,7 @@ done
 
 case $mode in
 preinstall)
-  confs=`find . -name Makefile.am -exec grep -l 'include .*/preinstall\.am' {} \;`
+  confs=`find $root -name Makefile.am -exec grep -l 'include .*/preinstall\.am' {} \;`
   for i in $confs; do
     dir=$(dirname $i);
     test "$quite" = "true" || echo "Generating $dir/preinstall.am"
@@ -141,7 +145,7 @@ generate)
     ;;
   esac
 
-  confs=`find . \( -name 'configure.in' -o -name 'configure.ac' \) -print`
+  confs=`find $root \( -name 'configure.in' -o -name 'configure.ac' \) -print`
   for i in $confs; do
   dir=`dirname $i`;
   configure=`basename $i`;
@@ -173,7 +177,7 @@ autoreconf)
     exit 1
   fi
 
-  confs=`find . -name 'configure.ac' -print`
+  confs=`find . -name 'configure.ac' -print $maxdepth`
   for i in $confs; do
   dir=`dirname $i`;
   configure=`basename $i`;
-- 
1.7.0.4




More information about the devel mailing list