ledger/tools/myacprep
John Wiegley 3ab52e74b1 Tools changes to build for multiple targets
This makes it easier for me to build a version of ledger with
optimizations, one for coverage analysis, one for profiling, etc.
2009-02-21 16:45:19 -04:00

49 lines
1.1 KiB
Bash
Executable file

#!/bin/sh
OUT=$HOME/Products
SWITCHES=""
saw_opt=false
while [ -n "$1" ]; do
case "$1" in
--local)
OUT=""
SWITCHES="$SWITCHES --local"
shift 1 ;;
--output)
OUT=""
shift 1
SWITCHES="$SWITCHES --output $1"
shift 1 ;;
--gprof)
OUT="$OUT/ledger-gprof"
SWITCHES="$SWITCHES $1 --release"
saw_opt=true
shift 1 ;;
--gcov)
OUT="$OUT/ledger-gcov"
SWITCHES="$SWITCHES $1 --debug --devel"
saw_opt=true
shift 1 ;;
--opt)
OUT="$OUT/ledger-opt"
SWITCHES="$SWITCHES $1 --release"
saw_opt=true
shift 1 ;;
esac
done
if [ $saw_opt = false ]; then
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
OUT="$OUT/ledger"
fi
if [ -n "$OUT" ]; then
[ -d "$OUT" ] || mkdir -p "$OUT"
SWITCHES="$SWITCHES --output $OUT"
fi
./acprep $SWITCHES "$@"