6 echo "usage: buildtarget target [path-to-linuxbios]"
14 lbpath=`dirname $lbpath`
17 target_dir=$lbpath/targets
19 config_dir=$lbpath/util/newconfig
20 yapps2_py=$config_dir/yapps2.py
21 config_g=$config_dir/config.g
23 if [ ! -d $target_dir ]; then
24 echo "Target directory not found"
30 if [ ! -f $config_lb ]; then
31 config_lb=$1/Config.lb
33 if [ ! -f $config_lb ]; then
34 echo "No target config file found"
35 echo "Tried both $1 and $config_lb"
39 target_subdir=$target_dir/`sed -n -e 's/^target \(.*\)$/\1/p' $config_lb`
40 config_py=$target_subdir/config.py
42 if [ ! -d $target_subdir ] ; then
43 mkdir -p $target_subdir
45 if [ ! -f $config_py ]; then
46 echo "No linuxbios config script found. Rebuilding it.."
47 $PYTHON $yapps2_py $config_g $config_py
50 # make sure config.py is up-to-date
52 export PYTHONPATH=$config_dir
53 $PYTHON $config_py $config_lb $lbpath