changeset 1197:e68cf4daeda4

Update build_Make* to handle ConfigTool generated trees
author gthomas
date Fri, 05 Sep 2003 13:57:29 +0000
parents ecbb5d87bfe0
children 593695e176a8
files examples/build_Make.params examples/build_Makefile
diffstat 2 files changed, 18 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/examples/build_Make.params
+++ b/examples/build_Make.params
@@ -5,13 +5,21 @@
 # the automatically generated Makefile (via the script
 # 'build_Makefile')
 
-# Copied from 'makefile' the "install" tree
+# Copied from 'makefile' in the "install" tree
 
-HOME=${1-`pwd`}
-if [ ! -d ${HOME}/install ]; then
-  echo "Not an eCos install tree"
-  echo "usage: <eCos_repository>/build_Make.params [<eCos_install_dir>]"
-  exit
+ECOS_BUILD_DIR=${1-`pwd`}
+ECOS_INSTALL_DIR=`echo ${ECOS_BUILD_DIR}/install`
+if [ ! -d ${ECOS_BUILD_DIR}/install ]; then
+  if [ ! -d ${ECOS_BUILD_DIR}/*_build ]; then
+    echo "Not an eCos install tree"
+    echo "usage: <eCos_repository>/build_Make.params [<eCos_install_dir>]"
+    echo "... where <eCos_install_dir> is the directory which contains"
+    echo "    the *.ecc configuration file used to build the kernel"
+    exit
+  else
+    ECOS_INSTALL_DIR=`echo ${ECOS_BUILD_DIR}/*_install`
+    ECOS_BUILD_DIR=`echo ${ECOS_BUILD_DIR}/*_build`
+  fi
 fi
 
 cat <<EOF >Make.params
@@ -20,7 +28,7 @@ cat <<EOF >Make.params
 
 EOF
 
-grep export ${HOME}/makefile >>Make.params
+grep export ${ECOS_BUILD_DIR}/makefile >>Make.params
 
 cat <<EOF >>Make.params
 
@@ -30,7 +38,7 @@ cat <<EOF >>Make.params
 
 EOF
 
-cat ${HOME}/install/include/pkgconf/ecos.mak >>Make.params
+cat ${ECOS_INSTALL_DIR}/include/pkgconf/ecos.mak >>Make.params
 
 
 
--- a/examples/build_Makefile
+++ b/examples/build_Makefile
@@ -6,15 +6,7 @@
 # usage: <eCos_repository>/build_Makefile [<eCos_install_dir>]
 # env:   ${SRCS} - the default list of source files
 #        ${DST}  - the default target
-
-HOME=${1-`pwd`}
-if [ ! -d ${HOME}/install ]; then
-  echo "Not an eCos install tree"
-  echo "usage: <eCos_repository>/build_Makefile [<eCos_install_dir>]"
-  echo "env:   \${SRCS} - the default list of source files"
-  echo "       \${DST}  - the default target"
-  exit
-fi
+ECOS_DIR=${1-`pwd`}
 
 cat <<EOF >Makefile
 #
@@ -42,6 +34,6 @@ EOF
 
 # Create actual parameters
 
-`dirname $0`/build_Make.params ${HOME}
+`dirname $0`/build_Make.params ${ECOS_DIR}