2003-07-17 19:50:11 +02:00
|
|
|
#!/bin/sh
|
2003-10-11 08:20:25 +02:00
|
|
|
PYTHON=python
|
2003-07-17 19:50:11 +02:00
|
|
|
# Target build script
|
|
|
|
|
|
|
|
if [ $# -lt 1 ]; then
|
|
|
|
echo "usage: buildtarget target [path-to-linuxbios]"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ $# -gt 1 ]; then
|
|
|
|
lbpath=$2
|
|
|
|
else
|
|
|
|
lbpath=`pwd`
|
|
|
|
lbpath=`dirname $lbpath`
|
|
|
|
fi
|
|
|
|
|
|
|
|
target_dir=$lbpath/targets
|
2003-10-01 07:42:31 +02:00
|
|
|
config_lb=$1
|
2003-07-23 23:30:29 +02:00
|
|
|
config_dir=$lbpath/util/newconfig
|
2003-10-11 08:20:25 +02:00
|
|
|
yapps2_py=$config_dir/yapps2.py
|
|
|
|
config_g=$config_dir/config.g
|
2003-07-17 19:50:11 +02:00
|
|
|
|
|
|
|
if [ ! -d $target_dir ]; then
|
|
|
|
echo "Target directory not found"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
cd $target_dir
|
|
|
|
|
2003-10-01 07:42:31 +02:00
|
|
|
if [ ! -f $config_lb ]; then
|
|
|
|
config_lb=$1/Config.lb
|
|
|
|
fi
|
2003-07-17 19:50:11 +02:00
|
|
|
if [ ! -f $config_lb ]; then
|
|
|
|
echo "No target config file found"
|
2003-10-01 07:42:31 +02:00
|
|
|
echo "Tried both $1 and $config_lb"
|
2003-07-17 19:50:11 +02:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2003-10-14 05:05:04 +02:00
|
|
|
build_dir=`dirname $config_lb`/`sed -n -e 's/^target \(.*\)$/\1/p' $config_lb`
|
|
|
|
echo $build_dir
|
|
|
|
config_py=$build_dir/config.py
|
2003-10-13 21:48:13 +02:00
|
|
|
|
|
|
|
if [ ! -d $target_subdir ] ; then
|
|
|
|
mkdir -p $target_subdir
|
|
|
|
fi
|
2003-07-17 19:50:11 +02:00
|
|
|
if [ ! -f $config_py ]; then
|
2003-09-08 17:01:19 +02:00
|
|
|
echo "No linuxbios config script found. Rebuilding it.."
|
2003-10-11 08:20:25 +02:00
|
|
|
$PYTHON $yapps2_py $config_g $config_py
|
2003-07-17 19:50:11 +02:00
|
|
|
fi
|
|
|
|
|
2003-07-23 23:30:29 +02:00
|
|
|
# make sure config.py is up-to-date
|
|
|
|
|
2003-10-11 08:20:25 +02:00
|
|
|
export PYTHONPATH=$config_dir
|
|
|
|
$PYTHON $config_py $config_lb $lbpath
|
2003-07-17 19:50:11 +02:00
|
|
|
|
|
|
|
exit $?
|