#!/bin/sh

OUT=$HOME/Products/ledger

if [ "$1" = "--local" ]; then
    OUT=""
elif [ "$1" = "--output" ]; then
    OUT=""
fi

SWITCHES=""
SWITCHES="$SWITCHES --pch"	# build using pre-compiled headers
SWITCHES="$SWITCHES --warn"	# show full compiler warnings
SWITCHES="$SWITCHES --debug"	# enable debug code generation
SWITCHES="$SWITCHES --devel"	# use GLIBCXX_DEBUG if possible

if [ -n "$OUT" -a -d "$OUT" ]; then
    # build in another directory, if it exists and there were no 
    SWITCHES="$SWITCHES --output $OUT"
fi

./acprep $SWITCHES "$@"