Skip to content

Commit 389f5a8

Browse files
robertchirasevanlucas
authored andcommitted
build: add script to create Android .mk files
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 <robert.chiras@intel.com> PR-URL: #5544 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
1 parent 5ee5fa2 commit 389f5a8

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

tools/create_android_makefiles

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/bin/bash
2+
# Run this script ONLY inside an Android build system
3+
# and after you ran lunch command!
4+
5+
if [ -z "$ANDROID_BUILD_TOP" ]; then
6+
echo "Run lunch before running this script!"
7+
exit 1
8+
fi
9+
10+
if [ -z "$1" ]; then
11+
ARCH="arm"
12+
else
13+
ARCH="$1"
14+
fi
15+
16+
if [ $ARCH = "x86" ]; then
17+
TARGET_ARCH="ia32"
18+
else
19+
TARGET_ARCH="$ARCH"
20+
fi
21+
22+
cd $(dirname $0)/..
23+
24+
./configure \
25+
--without-snapshot \
26+
--openssl-no-asm \
27+
--dest-cpu=$TARGET_ARCH \
28+
--dest-os=android
29+
30+
export GYP_GENERATORS="android"
31+
export GYP_GENERATOR_FLAGS="limit_to_target_all=true"
32+
GYP_DEFINES="target_arch=$TARGET_ARCH"
33+
GYP_DEFINES+=" v8_target_arch=$TARGET_ARCH"
34+
GYP_DEFINES+=" android_target_arch=$ARCH"
35+
GYP_DEFINES+=" host_os=linux OS=android"
36+
export GYP_DEFINES
37+
38+
./deps/npm/node_modules/node-gyp/gyp/gyp \
39+
-Icommon.gypi \
40+
-Iconfig.gypi \
41+
--depth=. \
42+
-Dcomponent=static_library \
43+
-Dlibrary=static_library \
44+
node.gyp
45+
46+
echo -e "LOCAL_PATH := \$(call my-dir)\n\ninclude \$(LOCAL_PATH)/GypAndroid.mk" > Android.mk

0 commit comments

Comments
 (0)