| Index: wrap_make |
| =================================================================== |
| new file mode 100755 |
| --- /dev/null |
| +++ b/wrap_make |
| @@ -0,0 +1,53 @@ |
| +#!/bin/sh |
| + |
| + |
| +outdir="v8/out/Debug" |
| +system=`uname -s` |
| +android_build=0 |
| + |
| +# the arguments are |
| +# [-a arch] [file1, ...] [-D outdir] -C dir ... |
| +# |
| +# -a if we are building for Android. arch target. |
| +# -D is the output directory to copy from |
| +# the rest is passed verbatim to make. |
| +if [ "$1" = "-a" ] ; then |
| + android_build=1 |
| + shift |
| + android_arch="$1" |
| + shift |
| +fi |
| +while [ "$1" != "-D" -a "$1" != "-C" ] ; do |
| + target="$target $1" |
| + shift |
| +done |
| +if [ "$1" = "-D" ] ; then |
| + shift |
| + outdir="$1" |
| + shift |
| +fi |
| + |
| +make $* && for t in $target ; do |
| + cp $outdir/$t . |
| + # When building for Android on Darwin we must execute ranlib |
| + if [ $android_build -eq 1 -a "$system" = "Darwin" ] ; then |
| + case "$android_arch" in |
| + arm64) |
| + ${ANDROID_NDK_ROOT}/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/bin/aarch64-linux-android-ranlib $t |
| + ;; |
| + arm) |
| + ${ANDROID_NDK_ROOT}/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-ranlib $t |
| + ;; |
| + ia32) |
| + ${ANDROID_NDK_ROOT}/toolchains/x86-4.9/prebuilt/darwin-x86_64/bin/i686-linux-android-ranlib $t |
| + ;; |
| + x64) |
| + ${ANDROID_NDK_ROOT}/toolchains/x86_64-4.9/prebuilt/darwin-x86_64/bin/x86_64-linux-android-ranlib $t |
| + ;; |
| + *) |
| + echo "Unknown architecture $android_arch" |
| + exit 255 |
| + ;; |
| + esac |
| + fi |
| +done |