diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2012-01-18 13:56:04 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2012-01-18 13:56:04 +0200 |
commit | 15a02ad7b83689833e0297c6dad2f51dcbe6a377 (patch) | |
tree | d2d483d049771227af235488197ec4f6bd3344a0 | |
parent | db7297e33f23fc769b9bfc43616ec087cc068b70 (diff) |
Add support for situation where src_root != out_root
-rwxr-xr-x | binary/mingw/build-dist | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/binary/mingw/build-dist b/binary/mingw/build-dist index e01679d..59ed868 100755 --- a/binary/mingw/build-dist +++ b/binary/mingw/build-dist @@ -12,6 +12,22 @@ function error () echo "$*" 1>&2 } +# Find output directory for a project. It is either $1-default or if +# that doesn't exist, it is $1. +# +function find_out_dir () +{ + # Get the actual directory in case -default is a symlink. + # + tmp=`realpath $1-default 2>/dev/null` + + if [ -n "$tmp" -a -d "$tmp" ]; then + echo "$tmp" + else + echo "$1" + fi +} + rebuild=n pack=n @@ -88,7 +104,8 @@ fi # Build libodb # if [ $pack = n ]; then - make -C $src_root/odb/libodb dist dist_prefix=$out_root/libodb + make -C `find_out_dir $src_root/odb/libodb` -f $src_root/odb/libodb/makefile \ + dist dist_prefix=$out_root/libodb if [ $rebuild = y ]; then cd libodb @@ -114,7 +131,8 @@ cd ../.. # Build libodb-boost # if [ $pack = n ]; then - make -C $src_root/odb/libodb-boost dist dist_prefix=$out_root/libodb-boost + make -C `find_out_dir $src_root/odb/libodb-boost` -f $src_root/odb/libodb-boost/makefile \ + dist dist_prefix=$out_root/libodb-boost if [ $rebuild = y ]; then cd libodb-boost @@ -139,7 +157,8 @@ cd .. # Build libodb-qt # if [ $pack = n ]; then - make -C $src_root/odb/libodb-qt dist dist_prefix=$out_root/libodb-qt + make -C `find_out_dir $src_root/odb/libodb-qt` -f $src_root/odb/libodb-qt/makefile \ + dist dist_prefix=$out_root/libodb-qt if [ $rebuild = y ]; then cd libodb-qt |