#!/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 if [ -n "$OUT" ]; then OUT="$OUT/ledger" fi fi if [ -n "$OUT" ]; then [ -d "$OUT" ] || mkdir -p "$OUT" SWITCHES="$SWITCHES --output $OUT" fi ./acprep $SWITCHES if [ -n "$OUT" ]; then ln -sf $OUT/TAGS . ln -sf $OUT/ledger . fi