Skip to content

Commit

Permalink
build: add script to create Android .mk files
Browse files Browse the repository at this point in the history
The create_android_makefiles script will create .mk files for node and
all of its dependencies ready to be build using Android build system.

Signed-off-by: Robert Chiras <[email protected]>
PR-URL: #5544
Reviewed-By: Ben Noordhuis <[email protected]>
  • Loading branch information
robertchiras authored and Myles Borins committed May 18, 2016
1 parent 4ad7184 commit 918d33a
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions tools/create_android_makefiles
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash
# Run this script ONLY inside an Android build system
# and after you ran lunch command!

if [ -z "$ANDROID_BUILD_TOP" ]; then
echo "Run lunch before running this script!"
exit 1
fi

if [ -z "$1" ]; then
ARCH="arm"
else
ARCH="$1"
fi

if [ $ARCH = "x86" ]; then
TARGET_ARCH="ia32"
else
TARGET_ARCH="$ARCH"
fi

cd $(dirname $0)/..

./configure \
--without-snapshot \
--openssl-no-asm \
--dest-cpu=$TARGET_ARCH \
--dest-os=android

export GYP_GENERATORS="android"
export GYP_GENERATOR_FLAGS="limit_to_target_all=true"
GYP_DEFINES="target_arch=$TARGET_ARCH"
GYP_DEFINES+=" v8_target_arch=$TARGET_ARCH"
GYP_DEFINES+=" android_target_arch=$ARCH"
GYP_DEFINES+=" host_os=linux OS=android"
export GYP_DEFINES

./deps/npm/node_modules/node-gyp/gyp/gyp \
-Icommon.gypi \
-Iconfig.gypi \
--depth=. \
-Dcomponent=static_library \
-Dlibrary=static_library \
node.gyp

echo -e "LOCAL_PATH := \$(call my-dir)\n\ninclude \$(LOCAL_PATH)/GypAndroid.mk" > Android.mk

0 comments on commit 918d33a

Please sign in to comment.