#! /bin/sh set -e echo "Make called: $*" # Try to avoid strange tricks with # patsh (get any help we may have from configure) abs_srcdir="@abs_srcdir@" case $abs_srcdir in @*@) abs_srcdir="$(dirname $(readlink -f $(which $0)))" ;; esac make="@MAKE@" case $make in @*@) make="make" esac cd "$abs_srcdir" if test "x$1" = "x"; then echo "First argument _must_ be the name of the build tree" exit 11 fi case $1 in */*) ;; *) echo "Uhm... something wrong in make parameters: $*" echo "Argument first argument should look like a path (match */*)" exit 15 ;; esac output="$1" scatch=${scatch-"../scatch"} base=${base-"../.."} temp=${tree-"../tree"} cache=${cache-"../cache"} shift # Build absolute paths output=`cd $output && pwd` scatch=`cd $scatch && pwd` base=`cd $base && pwd` temp=`cd $temp && pwd` cache=`cd $cache && pwd` test -d "$output/build" || mkdir "$output/build" if test ! -d "$output/build"; then echo 1>&2 "Output dir could not be created (${output}/build)" exit 12 fi cd "$output/build" echo "${spacing}Making ($@)... (make.log)" set +e export input_dir="${test_path}/input/`echo $test_file|sed -e s@.*/@@`" export output_dir="${test_path}/output/`echo $test_file|sed -e s@.*/@@`" export build_library_tree export build_src_tree export link_output $make $@ &> make.log status="$?" set -e if test "x$status" != "x0"; then echo "** Make failed" echo "** command line: $make $@" tail "./make.log" cd - exit 1 fi cd -