| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 ifeq ($(HOST_OS), mac) | 42 ifeq ($(HOST_OS), mac) |
| 43 TOOLCHAIN_DIR = darwin-$(ANDROID_NDK_HOST_ARCH) | 43 TOOLCHAIN_DIR = darwin-$(ANDROID_NDK_HOST_ARCH) |
| 44 else | 44 else |
| 45 $(error Host platform "${HOST_OS}" is not supported) | 45 $(error Host platform "${HOST_OS}" is not supported) |
| 46 endif | 46 endif |
| 47 endif | 47 endif |
| 48 | 48 |
| 49 ifeq ($(ARCH), android_arm) | 49 ifeq ($(ARCH), android_arm) |
| 50 DEFINES = target_arch=arm v8_target_arch=arm android_target_arch=arm | 50 DEFINES = target_arch=arm v8_target_arch=arm android_target_arch=arm |
| 51 DEFINES += arm_neon=0 arm_version=7 | 51 DEFINES += arm_neon=0 arm_version=7 |
| 52 TOOLCHAIN_ARCH = arm-linux-androideabi-4.6 | 52 TOOLCHAIN_ARCH = arm-linux-androideabi |
| 53 TOOLCHAIN_VER = 4.6 |
| 53 else | 54 else |
| 54 ifeq ($(ARCH), android_a64) | 55 ifeq ($(ARCH), android_a64) |
| 55 DEFINES = target_arch=a64 v8_target_arch=a64 android_target_arch=aarch64 | 56 DEFINES = target_arch=a64 v8_target_arch=a64 android_target_arch=arm64 |
| 56 TOOLCHAIN_ARCH = aarch64-linux-android-4.8 | 57 TOOLCHAIN_ARCH = aarch64-linux-android |
| 58 TOOLCHAIN_VER = 4.8 |
| 57 else | 59 else |
| 58 ifeq ($(ARCH), android_mipsel) | 60 ifeq ($(ARCH), android_mipsel) |
| 59 DEFINES = target_arch=mipsel v8_target_arch=mipsel | 61 DEFINES = target_arch=mipsel v8_target_arch=mipsel |
| 60 DEFINES += android_target_arch=mips mips_arch_variant=mips32r2 | 62 DEFINES += android_target_arch=mips mips_arch_variant=mips32r2 |
| 61 TOOLCHAIN_ARCH = mipsel-linux-android-4.6 | 63 TOOLCHAIN_ARCH = mipsel-linux-android |
| 64 TOOLCHAIN_VER = 4.6 |
| 65 |
| 62 else | 66 else |
| 63 ifeq ($(ARCH), android_ia32) | 67 ifeq ($(ARCH), android_ia32) |
| 64 DEFINES = target_arch=ia32 v8_target_arch=ia32 android_target_arch=x86 | 68 DEFINES = target_arch=ia32 v8_target_arch=ia32 android_target_arch=x86 |
| 65 TOOLCHAIN_ARCH = x86-4.6 | 69 TOOLCHAIN_ARCH = x86 |
| 70 TOOLCHAIN_VER = 4.6 |
| 66 else | 71 else |
| 67 $(error Target architecture "${ARCH}" is not supported) | 72 $(error Target architecture "${ARCH}" is not supported) |
| 68 endif | 73 endif |
| 69 endif | 74 endif |
| 70 endif | 75 endif |
| 71 endif | 76 endif |
| 72 | 77 |
| 73 TOOLCHAIN_PATH = ${ANDROID_NDK_ROOT}/toolchains/${TOOLCHAIN_ARCH}/prebuilt | 78 TOOLCHAIN_PATH = \ |
| 79 ${ANDROID_NDK_ROOT}/toolchains/${TOOLCHAIN_ARCH}-${TOOLCHAIN_VER}/prebuilt |
| 74 ANDROID_TOOLCHAIN ?= ${TOOLCHAIN_PATH}/${TOOLCHAIN_DIR} | 80 ANDROID_TOOLCHAIN ?= ${TOOLCHAIN_PATH}/${TOOLCHAIN_DIR} |
| 75 ifeq ($(wildcard $(ANDROID_TOOLCHAIN)),) | 81 ifeq ($(wildcard $(ANDROID_TOOLCHAIN)),) |
| 76 $(error Cannot find Android toolchain in "${ANDROID_TOOLCHAIN}". Please \ | 82 $(error Cannot find Android toolchain in "${ANDROID_TOOLCHAIN}". Please \ |
| 77 check that ANDROID_NDK_ROOT and ANDROID_NDK_HOST_ARCH are set \ | 83 check that ANDROID_NDK_ROOT and ANDROID_NDK_HOST_ARCH are set \ |
| 78 correctly) | 84 correctly) |
| 79 endif | 85 endif |
| 80 | 86 |
| 81 # For mksnapshot host generation. | 87 # For mksnapshot host generation. |
| 82 DEFINES += host_os=${HOST_OS} | 88 DEFINES += host_os=${HOST_OS} |
| 83 | 89 |
| 84 .SECONDEXPANSION: | 90 .SECONDEXPANSION: |
| 85 $(ANDROID_BUILDS): $(OUTDIR)/Makefile.$$@ | 91 $(ANDROID_BUILDS): $(OUTDIR)/Makefile.$$@ |
| 86 @$(MAKE) -C "$(OUTDIR)" -f Makefile.$@ \ | 92 @$(MAKE) -C "$(OUTDIR)" -f Makefile.$@ \ |
| 87 » CXX="$(ANDROID_TOOLCHAIN)/bin/*-g++" \ | 93 » CXX="$(ANDROID_TOOLCHAIN)/bin/${TOOLCHAIN_ARCH}-g++" \ |
| 88 » AR="$(ANDROID_TOOLCHAIN)/bin/*-ar" \ | 94 » AR="$(ANDROID_TOOLCHAIN)/bin/${TOOLCHAIN_ARCH}-ar" \ |
| 89 » RANLIB="$(ANDROID_TOOLCHAIN)/bin/*-ranlib" \ | 95 » RANLIB="$(ANDROID_TOOLCHAIN)/bin/${TOOLCHAIN_ARCH}-ranlib" \ |
| 90 » CC="$(ANDROID_TOOLCHAIN)/bin/*-gcc" \ | 96 » CC="$(ANDROID_TOOLCHAIN)/bin/${TOOLCHAIN_ARCH}-gcc" \ |
| 91 » LD="$(ANDROID_TOOLCHAIN)/bin/*-ld" \ | 97 » LD="$(ANDROID_TOOLCHAIN)/bin/${TOOLCHAIN_ARCH}-ld" \ |
| 92 » LINK="$(ANDROID_TOOLCHAIN)/bin/*-g++" \ | 98 » LINK="$(ANDROID_TOOLCHAIN)/bin/${TOOLCHAIN_ARCH}-g++" \ |
| 93 BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \ | 99 BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \ |
| 94 python -c "print raw_input().capitalize()") \ | 100 python -c "print raw_input().capitalize()") \ |
| 95 builddir="$(shell pwd)/$(OUTDIR)/$@" | 101 builddir="$(shell pwd)/$(OUTDIR)/$@" |
| 96 | 102 |
| 97 # Android GYP file generation targets. | 103 # Android GYP file generation targets. |
| 98 ANDROID_MAKEFILES = $(addprefix $(OUTDIR)/Makefile.,$(ANDROID_BUILDS)) | 104 ANDROID_MAKEFILES = $(addprefix $(OUTDIR)/Makefile.,$(ANDROID_BUILDS)) |
| 99 $(ANDROID_MAKEFILES): | 105 $(ANDROID_MAKEFILES): |
| 100 GYP_GENERATORS=make-android \ | 106 GYP_GENERATORS=make-android \ |
| 101 GYP_DEFINES="${DEFINES}" \ | 107 GYP_DEFINES="${DEFINES}" \ |
| 102 » CC="${ANDROID_TOOLCHAIN}/bin/*-gcc" \ | 108 » CC="${ANDROID_TOOLCHAIN}/bin/${TOOLCHAIN_ARCH}-gcc" \ |
| 103 » CXX="${ANDROID_TOOLCHAIN}/bin/*-g++" \ | 109 » CXX="${ANDROID_TOOLCHAIN}/bin/${TOOLCHAIN_ARCH}-g++" \ |
| 104 PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(PYTHONPATH)" \ | 110 PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(PYTHONPATH)" \ |
| 105 build/gyp/gyp --generator-output="${OUTDIR}" build/all.gyp \ | 111 build/gyp/gyp --generator-output="${OUTDIR}" build/all.gyp \ |
| 106 -Ibuild/standalone.gypi --depth=. -Ibuild/android.gypi \ | 112 -Ibuild/standalone.gypi --depth=. -Ibuild/android.gypi \ |
| 107 -S$(suffix $(basename $@))$(suffix $@) ${GYPFLAGS} | 113 -S$(suffix $(basename $@))$(suffix $@) ${GYPFLAGS} |
| OLD | NEW |