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