diff options
author | John Wiegley <johnw@newartisans.com> | 2009-02-21 16:45:19 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-02-21 16:45:19 -0400 |
commit | 3ab52e74b1de1c0be647eb36386ef5e16baeb60d (patch) | |
tree | 7f2b9db65ab74b3eda2e75c7c1062cc3f75e42fc /tools/myacprep | |
parent | 3d326956ef79cd1b623afa65b994a26b17dc6f24 (diff) | |
download | fork-ledger-3ab52e74b1de1c0be647eb36386ef5e16baeb60d.tar.gz fork-ledger-3ab52e74b1de1c0be647eb36386ef5e16baeb60d.tar.bz2 fork-ledger-3ab52e74b1de1c0be647eb36386ef5e16baeb60d.zip |
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.
Diffstat (limited to 'tools/myacprep')
-rwxr-xr-x | tools/myacprep | 53 |
1 files changed, 40 insertions, 13 deletions
diff --git a/tools/myacprep b/tools/myacprep index 7c4e2c14..39ed4f23 100755 --- a/tools/myacprep +++ b/tools/myacprep @@ -1,21 +1,48 @@ #!/bin/sh -OUT=$HOME/Products/ledger +OUT=$HOME/Products +SWITCHES="" -if [ "$1" = "--local" ]; then - OUT="" -elif [ "$1" = "--output" ]; then - OUT="" -fi +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 -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 [ $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" -a -d "$OUT" ]; then - # build in another directory, if it exists and there were no +if [ -n "$OUT" ]; then + [ -d "$OUT" ] || mkdir -p "$OUT" SWITCHES="$SWITCHES --output $OUT" fi |