Version 2.0.0 (small API change)
[nikiroo-utils.git] / export.sh
index b0fdddf982d89e22cfd429cfd9c832462d274611..0cff17bfe4d73ca520a6b54cfef2867ab25c3d63 100755 (executable)
--- a/export.sh
+++ b/export.sh
@@ -3,6 +3,7 @@
 # Export script
 # 
 # Version:
+# - 1.1.0: allow multiple targets
 # - 1.0.0: add a version comment
 
 cd "`dirname "$0"`"
@@ -10,16 +11,19 @@ cd "`dirname "$0"`"
 if [ "$1" = "" ]; then
        echo "You need to specify where to export it" >&2
        exit 1
-elif [ ! -d "$1/libs" ]; then
-       echo "The target export directory is not compatible" >&2
-       exit 2
 fi
 
 LIBNAME="`cat configure.sh | grep '^echo "NAME = ' | cut -d'"' -f2 | cut -d= -f2`"
 LIBNAME="`echo $LIBNAME`"
 
 make mrpropre
-./configure.sh && make \
-       && cp "$LIBNAME"-`cat VERSION`-sources.jar "$1"/libs/ \
-       && cp "$LIBNAME".jar "$1"/libs/
+./configure.sh && make
+if [ $? = 0 ]; then
+       while [ "$1" != "" ]; do
+               mkdir -p "$1"/libs/
+               cp "$LIBNAME"-`cat VERSION`-sources.jar "$1"/libs/
+               cp "$LIBNAME".jar "$1"/libs/
+               shift
+       done
+fi