OLD | NEW |
1 # Copyright 2012 the V8 project authors. All rights reserved. | 1 # Copyright 2012 the V8 project authors. All rights reserved. |
2 # Redistribution and use in source and binary forms, with or without | 2 # Redistribution and use in source and binary forms, with or without |
3 # modification, are permitted provided that the following conditions are | 3 # modification, are permitted provided that the following conditions are |
4 # met: | 4 # met: |
5 # | 5 # |
6 # * Redistributions of source code must retain the above copyright | 6 # * Redistributions of source code must retain the above copyright |
7 # notice, this list of conditions and the following disclaimer. | 7 # notice, this list of conditions and the following disclaimer. |
8 # * Redistributions in binary form must reproduce the above | 8 # * Redistributions in binary form must reproduce the above |
9 # copyright notice, this list of conditions and the following | 9 # copyright notice, this list of conditions and the following |
10 # disclaimer in the documentation and/or other materials provided | 10 # disclaimer in the documentation and/or other materials provided |
(...skipping 17 matching lines...) Expand all Loading... |
28 # Those definitions should be consistent with the main Makefile | 28 # Those definitions should be consistent with the main Makefile |
29 ANDROID_ARCHES = android_ia32 android_x64 android_arm android_arm64 \ | 29 ANDROID_ARCHES = android_ia32 android_x64 android_arm android_arm64 \ |
30 android_mipsel android_x87 | 30 android_mipsel android_x87 |
31 MODES = release debug | 31 MODES = release debug |
32 | 32 |
33 # Generates all combinations of ANDROID ARCHES and MODES, | 33 # Generates all combinations of ANDROID ARCHES and MODES, |
34 # e.g. "android_ia32.release" or "android_arm.release" | 34 # e.g. "android_ia32.release" or "android_arm.release" |
35 ANDROID_BUILDS = $(foreach mode,$(MODES), \ | 35 ANDROID_BUILDS = $(foreach mode,$(MODES), \ |
36 $(addsuffix .$(mode),$(ANDROID_ARCHES))) | 36 $(addsuffix .$(mode),$(ANDROID_ARCHES))) |
37 | 37 |
| 38 HOST_OS = $(shell uname -s | sed -e 's/Linux/linux/;s/Darwin/darwin/') |
| 39 HOST_ARCH = $(shell uname -m | sed -e 's/i[3456]86/x86/') |
| 40 |
38 ifeq ($(ARCH), android_arm) | 41 ifeq ($(ARCH), android_arm) |
39 DEFINES = target_arch=arm v8_target_arch=arm | 42 DEFINES = target_arch=arm v8_target_arch=arm |
| 43 ANDROID_TOOLCHAIN = $(ANDROID_NDK_ROOT)/toolchains/arm-linux-androideabi-4.9/p
rebuilt/$(HOST_OS)-$(HOST_ARCH)/arm-linux-androideabi/bin |
40 else ifeq ($(ARCH), android_arm64) | 44 else ifeq ($(ARCH), android_arm64) |
41 DEFINES = target_arch=arm64 v8_target_arch=arm64 | 45 DEFINES = target_arch=arm64 v8_target_arch=arm64 |
| 46 ANDROID_TOOLCHAIN = $(ANDROID_NDK_ROOT)/toolchains/aarch64-linux-android-4.9/p
rebuilt/$(HOST_OS)-$(HOST_ARCH)/aarch64-linux-android/bin |
42 else ifeq ($(ARCH), android_mipsel) | 47 else ifeq ($(ARCH), android_mipsel) |
43 DEFINES = target_arch=mipsel v8_target_arch=mipsel | 48 DEFINES = target_arch=mipsel v8_target_arch=mipsel |
| 49 ANDROID_TOOLCHAIN = $(ANDROID_NDK_ROOT)/toolchains/mipsel-linux-android-4.9/pr
ebuilt/$(HOST_OS)-$(HOST_ARCH)/mipsel-linux-android/bin |
44 else ifeq ($(ARCH), android_ia32) | 50 else ifeq ($(ARCH), android_ia32) |
45 DEFINES = target_arch=ia32 v8_target_arch=ia32 | 51 DEFINES = target_arch=ia32 v8_target_arch=ia32 |
| 52 ANDROID_TOOLCHAIN = $(ANDROID_NDK_ROOT)/toolchains/x86-4.9/prebuilt/$(HOST_OS)
-$(HOST_ARCH)/i686-linux-android/bin |
46 else ifeq ($(ARCH), android_x64) | 53 else ifeq ($(ARCH), android_x64) |
47 DEFINES = target_arch=x64 v8_target_arch=x64 | 54 DEFINES = target_arch=x64 v8_target_arch=x64 |
| 55 ANDROID_TOOLCHAIN = $(ANDROID_NDK_ROOT)/toolchains/x86_64-4.9/prebuilt/$(HOST_
OS)-$(HOST_ARCH)/x86_64-linux-android/bin |
48 else ifeq ($(ARCH), android_x87) | 56 else ifeq ($(ARCH), android_x87) |
49 DEFINES = target_arch=ia32 v8_target_arch=x87 | 57 DEFINES = target_arch=ia32 v8_target_arch=x87 |
| 58 ANDROID_TOOLCHAIN = $(ANDROID_NDK_ROOT)/toolchains/x86-4.9/prebuilt/$(HOST_OS)
-$(HOST_ARCH)/i686-linux-android/bin |
50 else | 59 else |
51 $(error Target architecture "${ARCH}" is not supported) | 60 $(error Target architecture "${ARCH}" is not supported) |
52 endif | 61 endif |
53 | 62 |
54 # Common flags. | 63 # Common flags. |
55 DEFINES += OS=android | 64 DEFINES += OS=android |
56 | 65 |
57 .SECONDEXPANSION: | 66 .SECONDEXPANSION: |
58 $(ANDROID_BUILDS): $(OUTDIR)/Makefile.$$@ | 67 $(ANDROID_BUILDS): $(OUTDIR)/Makefile.$$@ |
59 @$(MAKE) -C "$(OUTDIR)" -f Makefile.$@ \ | 68 @$(MAKE) -C "$(OUTDIR)" -f Makefile.$@ \ |
| 69 AR="$(ANDROID_TOOLCHAIN)/ar" \ |
60 BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \ | 70 BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \ |
61 python -c "print raw_input().capitalize()") \ | 71 python -c "print raw_input().capitalize()") \ |
62 builddir="$(shell pwd)/$(OUTDIR)/$@" | 72 builddir="$(shell pwd)/$(OUTDIR)/$@" |
63 | 73 |
64 # Android GYP file generation targets. | 74 # Android GYP file generation targets. |
65 ANDROID_MAKEFILES = $(addprefix $(OUTDIR)/Makefile.,$(ANDROID_BUILDS)) | 75 ANDROID_MAKEFILES = $(addprefix $(OUTDIR)/Makefile.,$(ANDROID_BUILDS)) |
66 $(ANDROID_MAKEFILES): | 76 $(ANDROID_MAKEFILES): |
67 GYP_GENERATORS=make-android \ | 77 GYP_GENERATORS=make-android \ |
68 GYP_DEFINES="${DEFINES}" \ | 78 GYP_DEFINES="${DEFINES}" \ |
69 PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(shell pwd)/build:
$(PYTHONPATH)" \ | 79 PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(shell pwd)/build:
$(PYTHONPATH)" \ |
70 build/gyp/gyp --generator-output="${OUTDIR}" build/all.gyp \ | 80 build/gyp/gyp --generator-output="${OUTDIR}" build/all.gyp \ |
71 -Ibuild/standalone.gypi --depth=. \ | 81 -Ibuild/standalone.gypi --depth=. \ |
72 -S$(suffix $(basename $@))$(suffix $@) ${GYPFLAGS} | 82 -S$(suffix $(basename $@))$(suffix $@) ${GYPFLAGS} |
OLD | NEW |