#! /bin/sh

top=$(dirname $0)
config=$1 ; shift
config_file=$top/config.$config.mk

if [ "x$config" = "x" ]; then
    echo "Usage: $0 <config> [<make target/option>]..." >&2	
    exit 1
fi

if [ ! -e $config_file ]; then
    echo "Configuration '$config' ($config_file) does not exist." >&2
    exit 1
fi

exec make -C ${top} CONFIG=$config "$@" origpwd="$PWD"
