| 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 |  | 
| 41 ifeq ($(ARCH), android_arm) | 38 ifeq ($(ARCH), android_arm) | 
| 42   DEFINES  = target_arch=arm v8_target_arch=arm | 39   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 |  | 
| 44 else ifeq ($(ARCH), android_arm64) | 40 else ifeq ($(ARCH), android_arm64) | 
| 45   DEFINES  = target_arch=arm64 v8_target_arch=arm64 | 41   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 |  | 
| 47 else ifeq ($(ARCH), android_mipsel) | 42 else ifeq ($(ARCH), android_mipsel) | 
| 48   DEFINES  = target_arch=mipsel v8_target_arch=mipsel | 43   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 |  | 
| 50 else ifeq ($(ARCH), android_ia32) | 44 else ifeq ($(ARCH), android_ia32) | 
| 51   DEFINES = target_arch=ia32 v8_target_arch=ia32 | 45   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 |  | 
| 53 else ifeq ($(ARCH), android_x64) | 46 else ifeq ($(ARCH), android_x64) | 
| 54   DEFINES = target_arch=x64 v8_target_arch=x64 | 47   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 |  | 
| 56 else ifeq ($(ARCH), android_x87) | 48 else ifeq ($(ARCH), android_x87) | 
| 57   DEFINES = target_arch=ia32 v8_target_arch=x87 | 49   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 |  | 
| 59 else | 50 else | 
| 60   $(error Target architecture "${ARCH}" is not supported) | 51   $(error Target architecture "${ARCH}" is not supported) | 
| 61 endif | 52 endif | 
| 62 | 53 | 
| 63 # Common flags. | 54 # Common flags. | 
| 64 DEFINES += OS=android | 55 DEFINES += OS=android | 
| 65 | 56 | 
| 66 .SECONDEXPANSION: | 57 .SECONDEXPANSION: | 
| 67 $(ANDROID_BUILDS): $(OUTDIR)/Makefile.$$@ | 58 $(ANDROID_BUILDS): $(OUTDIR)/Makefile.$$@ | 
| 68         @$(MAKE) -C "$(OUTDIR)" -f Makefile.$@ \ | 59         @$(MAKE) -C "$(OUTDIR)" -f Makefile.$@ \ | 
| 69                   AR="$(ANDROID_TOOLCHAIN)/ar" \ |  | 
| 70                   BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \ | 60                   BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \ | 
| 71                               python -c "print raw_input().capitalize()") \ | 61                               python -c "print raw_input().capitalize()") \ | 
| 72                   builddir="$(shell pwd)/$(OUTDIR)/$@" | 62                   builddir="$(shell pwd)/$(OUTDIR)/$@" | 
| 73 | 63 | 
| 74 # Android GYP file generation targets. | 64 # Android GYP file generation targets. | 
| 75 ANDROID_MAKEFILES = $(addprefix $(OUTDIR)/Makefile.,$(ANDROID_BUILDS)) | 65 ANDROID_MAKEFILES = $(addprefix $(OUTDIR)/Makefile.,$(ANDROID_BUILDS)) | 
| 76 $(ANDROID_MAKEFILES): | 66 $(ANDROID_MAKEFILES): | 
| 77         GYP_GENERATORS=make-android \ | 67         GYP_GENERATORS=make-android \ | 
| 78         GYP_DEFINES="${DEFINES}" \ | 68         GYP_DEFINES="${DEFINES}" \ | 
| 79 »       PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(shell pwd)/build:
    $(PYTHONPATH)" \ | 69 »       PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(shell pwd)/gypfil
    es:$(PYTHONPATH)" \ | 
| 80         tools/gyp/gyp --generator-output="${OUTDIR}" gypfiles/all.gyp \ | 70         tools/gyp/gyp --generator-output="${OUTDIR}" gypfiles/all.gyp \ | 
| 81                       -Igypfiles/standalone.gypi --depth=. \ | 71                       -Igypfiles/standalone.gypi --depth=. \ | 
| 82                       -S$(suffix $(basename $@))$(suffix $@) ${GYPFLAGS} | 72                       -S$(suffix $(basename $@))$(suffix $@) ${GYPFLAGS} | 
| OLD | NEW | 
|---|