Ying Wang | b9aa5d4 | 2014-05-13 13:57:28 -0700 | [diff] [blame] | 1 | # Rules to build boot.art |
| 2 | # Input variables: |
| 3 | # my_2nd_arch_prefix: indicates if this is to build for the 2nd arch. |
| 4 | |
| 5 | # The image "location" is a symbolic path that with multiarchitecture |
| 6 | # support doesn't really exist on the device. Typically it is |
| 7 | # /system/framework/boot.art and should be the same for all supported |
| 8 | # architectures on the device. The concrete architecture specific |
| 9 | # content actually ends up in a "filename" that contains an |
| 10 | # architecture specific directory name such as arm, arm64, mips, |
| 11 | # mips64, x86, x86_64. |
| 12 | # |
| 13 | # Here are some example values for an x86_64 / x86 configuration: |
| 14 | # |
| 15 | # DEFAULT_DEX_PREOPT_BUILT_IMAGE_LOCATION=out/target/product/generic_x86_64/dex_bootjars/system/framework/boot.art |
| 16 | # DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME=out/target/product/generic_x86_64/dex_bootjars/system/framework/x86_64/boot.art |
| 17 | # LIBART_BOOT_IMAGE=/system/framework/x86_64/boot.art |
| 18 | # |
| 19 | # 2ND_DEFAULT_DEX_PREOPT_BUILT_IMAGE_LOCATION=out/target/product/generic_x86_64/dex_bootjars/system/framework/boot.art |
| 20 | # 2ND_DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME=out/target/product/generic_x86_64/dex_bootjars/system/framework/x86/boot.art |
| 21 | # 2ND_LIBART_BOOT_IMAGE=/system/framework/x86/boot.art |
| 22 | |
| 23 | $(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_BUILT_IMAGE_LOCATION := $(DEXPREOPT_BOOT_JAR_DIR_FULL_PATH)/boot.art |
| 24 | $(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME := $(DEXPREOPT_BOOT_JAR_DIR_FULL_PATH)/$($(my_2nd_arch_prefix)DEX2OAT_TARGET_ARCH)/boot.art |
| 25 | $(my_2nd_arch_prefix)LIBART_BOOT_IMAGE_FILENAME := /$(DEXPREOPT_BOOT_JAR_DIR)/$($(my_2nd_arch_prefix)DEX2OAT_TARGET_ARCH)/boot.art |
| 26 | |
| 27 | # The .oat with symbols |
| 28 | $(my_2nd_arch_prefix)LIBART_TARGET_BOOT_OAT_UNSTRIPPED := $(TARGET_OUT_UNSTRIPPED)$(patsubst %.art,%.oat,$($(my_2nd_arch_prefix)LIBART_BOOT_IMAGE_FILENAME)) |
| 29 | |
Ying Wang | b9aa5d4 | 2014-05-13 13:57:28 -0700 | [diff] [blame] | 30 | $(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_INSTALLED_IMAGE := $(PRODUCT_OUT)$($(my_2nd_arch_prefix)LIBART_BOOT_IMAGE_FILENAME) |
Colin Cross | 52dcb2f | 2016-03-08 13:21:49 -0800 | [diff] [blame] | 31 | $(my_2nd_arch_prefix)LIBART_TARGET_BOOT_ART_EXTRA_INSTALLED_FILES := $(addprefix $(dir $($(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_INSTALLED_IMAGE)),\ |
| 32 | $(LIBART_TARGET_BOOT_ART_EXTRA_FILES)) |
Ying Wang | b9aa5d4 | 2014-05-13 13:57:28 -0700 | [diff] [blame] | 33 | |
Andreas Gampe | 96a5220 | 2014-11-18 11:45:10 -0800 | [diff] [blame] | 34 | # If we have a compiled-classes file, create a parameter. |
| 35 | COMPILED_CLASSES_FLAGS := |
| 36 | ifneq ($(COMPILED_CLASSES),) |
| 37 | COMPILED_CLASSES_FLAGS := --compiled-classes=$(COMPILED_CLASSES) |
| 38 | endif |
| 39 | |
Colin Cross | 52dcb2f | 2016-03-08 13:21:49 -0800 | [diff] [blame] | 40 | # The rule to install boot.art |
| 41 | # Depends on installed boot.oat, boot-*.art, boot-*.oat |
| 42 | $($(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_INSTALLED_IMAGE) : $($(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME) | $(ACP) $($(my_2nd_arch_prefix)LIBART_TARGET_BOOT_ART_EXTRA_INSTALLED_FILES) |
| 43 | @echo "Install: $@" |
| 44 | $(copy-file-to-target) |
| 45 | |
| 46 | # The rule to install boot.oat, boot-*.art, boot-*.oat |
| 47 | # Depends on built-but-not-installed boot.art |
| 48 | $($(my_2nd_arch_prefix)LIBART_TARGET_BOOT_ART_EXTRA_INSTALLED_FILES) : $($(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME) | $(ACP) |
| 49 | @echo "Install: $@" |
| 50 | @mkdir -p $(dir $@) |
| 51 | $(hide) $(ACP) -fp $(dir $<)$(notdir $@) $@ |
Ying Wang | b9aa5d4 | 2014-05-13 13:57:28 -0700 | [diff] [blame] | 52 | |
| 53 | $($(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME): PRIVATE_2ND_ARCH_VAR_PREFIX := $(my_2nd_arch_prefix) |
| 54 | # Use dex2oat debug version for better error reporting |
Andreas Gampe | da6ddc4 | 2016-10-12 09:35:39 -0700 | [diff] [blame] | 55 | $($(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME) : $(LIBART_TARGET_BOOT_DEX_FILES) $(PRELOADED_CLASSES) $(COMPILED_CLASSES) $(DEX2OAT_DEPENDENCY) |
Shinichiro Hamaji | 9cb7692 | 2015-12-18 15:50:10 +0900 | [diff] [blame] | 56 | @echo "target dex2oat: $@" |
Ying Wang | b9aa5d4 | 2014-05-13 13:57:28 -0700 | [diff] [blame] | 57 | @mkdir -p $(dir $@) |
| 58 | @mkdir -p $(dir $($(PRIVATE_2ND_ARCH_VAR_PREFIX)LIBART_TARGET_BOOT_OAT_UNSTRIPPED)) |
Jeff Hao | d1d3fd9 | 2015-12-16 17:20:11 -0800 | [diff] [blame] | 59 | @rm -f $(dir $@)/*.art $(dir $@)/*.oat |
| 60 | @rm -f $(dir $($(PRIVATE_2ND_ARCH_VAR_PREFIX)LIBART_TARGET_BOOT_OAT_UNSTRIPPED))/*.art |
| 61 | @rm -f $(dir $($(PRIVATE_2ND_ARCH_VAR_PREFIX)LIBART_TARGET_BOOT_OAT_UNSTRIPPED))/*.oat |
Joe Onorato | 632db64 | 2016-03-17 10:12:36 -0700 | [diff] [blame] | 62 | $(hide) ANDROID_LOG_TAGS="*:e" $(DEX2OAT) --runtime-arg -Xms$(DEX2OAT_IMAGE_XMS) \ |
| 63 | --runtime-arg -Xmx$(DEX2OAT_IMAGE_XMX) \ |
Brian Carlstrom | cffe289 | 2014-07-08 10:35:29 -0700 | [diff] [blame] | 64 | --image-classes=$(PRELOADED_CLASSES) \ |
Ying Wang | b9aa5d4 | 2014-05-13 13:57:28 -0700 | [diff] [blame] | 65 | $(addprefix --dex-file=,$(LIBART_TARGET_BOOT_DEX_FILES)) \ |
| 66 | $(addprefix --dex-location=,$(LIBART_TARGET_BOOT_DEX_LOCATIONS)) \ |
| 67 | --oat-symbols=$($(PRIVATE_2ND_ARCH_VAR_PREFIX)LIBART_TARGET_BOOT_OAT_UNSTRIPPED) \ |
| 68 | --oat-file=$(patsubst %.art,%.oat,$@) \ |
| 69 | --oat-location=$(patsubst %.art,%.oat,$($(PRIVATE_2ND_ARCH_VAR_PREFIX)LIBART_BOOT_IMAGE_FILENAME)) \ |
| 70 | --image=$@ --base=$(LIBART_IMG_TARGET_BASE_ADDRESS) \ |
| 71 | --instruction-set=$($(PRIVATE_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_ARCH) \ |
Ian Rogers | a18a283 | 2014-10-17 01:05:50 -0700 | [diff] [blame] | 72 | --instruction-set-variant=$($(PRIVATE_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_CPU_VARIANT) \ |
Ying Wang | b9aa5d4 | 2014-05-13 13:57:28 -0700 | [diff] [blame] | 73 | --instruction-set-features=$($(PRIVATE_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES) \ |
Richard Uhler | c30981e | 2016-12-05 11:47:02 +0000 | [diff] [blame] | 74 | --android-root=$(PRODUCT_OUT)/system \ |
| 75 | --include-patch-information --runtime-arg -Xnorelocate --compile-pic \ |
Alexey Alexandrov | e469063 | 2016-09-19 10:54:21 -0700 | [diff] [blame] | 76 | --no-generate-debug-info --generate-build-id \ |
Jeff Hao | d1d3fd9 | 2015-12-16 17:20:11 -0800 | [diff] [blame] | 77 | --multi-image --no-inline-from=core-oj.jar \ |
Andreas Gampe | 907fb03 | 2016-04-11 15:10:09 -0700 | [diff] [blame] | 78 | $(PRODUCT_DEX_PREOPT_BOOT_FLAGS) $(GLOBAL_DEXPREOPT_FLAGS) $(COMPILED_CLASSES_FLAGS) $(ART_BOOT_IMAGE_EXTRA_ARGS) |