Brian Carlstrom | 1619286 | 2011-09-12 17:50:06 -0700 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2011 The Android Open Source Project |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | # |
| 16 | |
Brian Carlstrom | 04941d9 | 2012-02-19 01:47:51 -0800 | [diff] [blame] | 17 | # DEX2OAT defined in build/core/config.mk |
Brian Carlstrom | 1619286 | 2011-09-12 17:50:06 -0700 | [diff] [blame] | 18 | DEX2OATD := $(HOST_OUT_EXECUTABLES)/dex2oatd$(HOST_EXECUTABLE_SUFFIX) |
Brian Carlstrom | 265091e | 2013-01-30 14:08:26 -0800 | [diff] [blame] | 19 | |
| 20 | LIBART_COMPILER := $(HOST_OUT_SHARED_LIBRARIES)/libart-compiler$(HOST_SHLIB_SUFFIX) |
| 21 | LIBARTD_COMPILER := $(HOST_OUT_SHARED_LIBRARIES)/libartd-compiler$(HOST_SHLIB_SUFFIX) |
| 22 | |
Brian Carlstrom | 1619286 | 2011-09-12 17:50:06 -0700 | [diff] [blame] | 23 | # TODO: for now, override with debug version for better error reporting |
| 24 | DEX2OAT := $(DEX2OATD) |
Brian Carlstrom | 265091e | 2013-01-30 14:08:26 -0800 | [diff] [blame] | 25 | LIBART_COMPILER := $(LIBARTD_COMPILER) |
Brian Carlstrom | 1619286 | 2011-09-12 17:50:06 -0700 | [diff] [blame] | 26 | |
Brian Carlstrom | 265091e | 2013-01-30 14:08:26 -0800 | [diff] [blame] | 27 | # By default, do not run rerun dex2oat if the tool changes. |
| 28 | # Comment out the | to force dex2oat to rerun on after all changes. |
| 29 | DEX2OAT_DEPENDENCY := | |
| 30 | DEX2OAT_DEPENDENCY += $(DEX2OAT) |
| 31 | DEX2OAT_DEPENDENCY += $(LIBART_COMPILER) |
Brian Carlstrom | 03a20ba | 2011-10-13 10:24:13 -0700 | [diff] [blame] | 32 | |
Brian Carlstrom | 78128a6 | 2011-09-15 17:21:19 -0700 | [diff] [blame] | 33 | OATDUMP := $(HOST_OUT_EXECUTABLES)/oatdump$(HOST_EXECUTABLE_SUFFIX) |
| 34 | OATDUMPD := $(HOST_OUT_EXECUTABLES)/oatdumpd$(HOST_EXECUTABLE_SUFFIX) |
| 35 | # TODO: for now, override with debug version for better error reporting |
| 36 | OATDUMP := $(OATDUMPD) |
| 37 | |
Brian Carlstrom | ae82698 | 2011-11-09 01:33:42 -0800 | [diff] [blame] | 38 | PRELOADED_CLASSES := frameworks/base/preloaded-classes |
| 39 | |
Brian Carlstrom | 27ec961 | 2011-09-19 20:20:38 -0700 | [diff] [blame] | 40 | ######################################################################## |
| 41 | # A smaller libcore only oat file |
Brian Carlstrom | 3b010aa | 2013-06-25 23:06:36 -0700 | [diff] [blame] | 42 | TARGET_CORE_JARS := core-libart conscrypt okhttp core-junit bouncycastle |
Brian Carlstrom | 87587cb | 2012-03-08 11:42:50 -0800 | [diff] [blame] | 43 | HOST_CORE_JARS := $(addsuffix -hostdex,$(TARGET_CORE_JARS)) |
Brian Carlstrom | 1619286 | 2011-09-12 17:50:06 -0700 | [diff] [blame] | 44 | |
Brian Carlstrom | a004aa9 | 2012-02-08 18:05:09 -0800 | [diff] [blame] | 45 | HOST_CORE_DEX_LOCATIONS := $(foreach jar,$(HOST_CORE_JARS), $(HOST_OUT_JAVA_LIBRARIES)/$(jar).jar) |
| 46 | TARGET_CORE_DEX_LOCATIONS := $(foreach jar,$(TARGET_CORE_JARS),/$(DEXPREOPT_BOOT_JAR_DIR)/$(jar).jar) |
| 47 | |
| 48 | HOST_CORE_DEX_FILES := $(foreach jar,$(HOST_CORE_JARS), $(call intermediates-dir-for,JAVA_LIBRARIES,$(jar),t,COMMON)/javalib.jar) |
| 49 | TARGET_CORE_DEX_FILES := $(foreach jar,$(TARGET_CORE_JARS),$(call intermediates-dir-for,JAVA_LIBRARIES,$(jar), ,COMMON)/javalib.jar) |
Brian Carlstrom | 1619286 | 2011-09-12 17:50:06 -0700 | [diff] [blame] | 50 | |
Brian Carlstrom | 27ec961 | 2011-09-19 20:20:38 -0700 | [diff] [blame] | 51 | HOST_CORE_OAT := $(HOST_OUT_JAVA_LIBRARIES)/core.oat |
Brian Carlstrom | a004aa9 | 2012-02-08 18:05:09 -0800 | [diff] [blame] | 52 | TARGET_CORE_OAT := $(ART_TEST_DIR)/core.oat |
Brian Carlstrom | 1619286 | 2011-09-12 17:50:06 -0700 | [diff] [blame] | 53 | |
Brian Carlstrom | a004aa9 | 2012-02-08 18:05:09 -0800 | [diff] [blame] | 54 | HOST_CORE_OAT_OUT := $(HOST_OUT_JAVA_LIBRARIES)/core.oat |
| 55 | TARGET_CORE_OAT_OUT := $(ART_TEST_OUT)/core.oat |
Brian Carlstrom | e24fa61 | 2011-09-29 00:53:55 -0700 | [diff] [blame] | 56 | |
Brian Carlstrom | a004aa9 | 2012-02-08 18:05:09 -0800 | [diff] [blame] | 57 | HOST_CORE_IMG_OUT := $(HOST_OUT_JAVA_LIBRARIES)/core.art |
| 58 | TARGET_CORE_IMG_OUT := $(ART_TEST_OUT)/core.art |
| 59 | |
TDYa127 | 58e63f9 | 2012-04-24 13:16:47 -0700 | [diff] [blame] | 60 | $(HOST_CORE_IMG_OUT): $(HOST_CORE_DEX_FILES) $(DEX2OAT_DEPENDENCY) |
Shih-wei Liao | 8cfa882 | 2012-04-21 01:54:10 -0700 | [diff] [blame] | 61 | @echo "host dex2oat: $@ ($?)" |
| 62 | @mkdir -p $(dir $@) |
Brian Carlstrom | 3f47c12 | 2013-03-07 00:02:40 -0800 | [diff] [blame] | 63 | $(hide) $(DEX2OAT) $(PARALLEL_ART_COMPILE_JOBS) --runtime-arg -Xms16m --runtime-arg -Xmx16m --image-classes=$(PRELOADED_CLASSES) $(addprefix --dex-file=,$(HOST_CORE_DEX_FILES)) $(addprefix --dex-location=,$(HOST_CORE_DEX_LOCATIONS)) --oat-file=$(HOST_CORE_OAT_OUT) --oat-location=$(HOST_CORE_OAT) --image=$(HOST_CORE_IMG_OUT) --base=$(IMG_HOST_BASE_ADDRESS) --instruction-set=$(HOST_ARCH) --host --android-root=$(HOST_OUT) |
Brian Carlstrom | 27ec961 | 2011-09-19 20:20:38 -0700 | [diff] [blame] | 64 | |
Shih-wei Liao | 8cfa882 | 2012-04-21 01:54:10 -0700 | [diff] [blame] | 65 | $(TARGET_CORE_IMG_OUT): $(TARGET_CORE_DEX_FILES) $(DEX2OAT_DEPENDENCY) |
| 66 | @echo "target dex2oat: $@ ($?)" |
| 67 | @mkdir -p $(dir $@) |
Brian Carlstrom | 3f47c12 | 2013-03-07 00:02:40 -0800 | [diff] [blame] | 68 | $(hide) $(DEX2OAT) $(PARALLEL_ART_COMPILE_JOBS) --runtime-arg -Xms16m --runtime-arg -Xmx16m --image-classes=$(PRELOADED_CLASSES) $(addprefix --dex-file=,$(TARGET_CORE_DEX_FILES)) $(addprefix --dex-location=,$(TARGET_CORE_DEX_LOCATIONS)) --oat-file=$(TARGET_CORE_OAT_OUT) --oat-location=$(TARGET_CORE_OAT) --image=$(TARGET_CORE_IMG_OUT) --base=$(IMG_TARGET_BASE_ADDRESS) --instruction-set=$(TARGET_ARCH) --host-prefix=$(PRODUCT_OUT) --android-root=$(PRODUCT_OUT)/system |
Brian Carlstrom | 27ec961 | 2011-09-19 20:20:38 -0700 | [diff] [blame] | 69 | |
Brian Carlstrom | 73666be | 2012-03-10 20:25:10 -0800 | [diff] [blame] | 70 | $(HOST_CORE_OAT_OUT): $(HOST_CORE_IMG_OUT) |
Brian Carlstrom | 2b7cdf4 | 2011-10-13 11:18:28 -0700 | [diff] [blame] | 71 | |
Brian Carlstrom | 73666be | 2012-03-10 20:25:10 -0800 | [diff] [blame] | 72 | $(TARGET_CORE_OAT_OUT): $(TARGET_CORE_IMG_OUT) |
Brian Carlstrom | 2b7cdf4 | 2011-10-13 11:18:28 -0700 | [diff] [blame] | 73 | |
Brian Carlstrom | cb91f1a | 2013-02-01 12:55:09 -0800 | [diff] [blame] | 74 | ifeq ($(ART_BUILD_HOST),true) |
Brian Carlstrom | 85545cd | 2012-06-27 14:28:06 -0700 | [diff] [blame] | 75 | include $(CLEAR_VARS) |
| 76 | LOCAL_MODULE := core.art-host |
| 77 | LOCAL_MODULE_TAGS := optional |
Brian Carlstrom | 51c2467 | 2013-07-11 16:00:56 -0700 | [diff] [blame^] | 78 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/build/Android.common.mk |
| 79 | LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/build/Android.oat.mk |
| 80 | LOCAL_ADDITIONAL_DEPENDENCIES += $(HOST_CORE_IMG_OUT) |
Brian Carlstrom | 85545cd | 2012-06-27 14:28:06 -0700 | [diff] [blame] | 81 | include $(BUILD_PHONY_PACKAGE) |
Brian Carlstrom | cb91f1a | 2013-02-01 12:55:09 -0800 | [diff] [blame] | 82 | endif |
Brian Carlstrom | 85545cd | 2012-06-27 14:28:06 -0700 | [diff] [blame] | 83 | |
Brian Carlstrom | 27ec961 | 2011-09-19 20:20:38 -0700 | [diff] [blame] | 84 | ######################################################################## |
| 85 | # The full system boot classpath |
| 86 | TARGET_BOOT_JARS := $(subst :, ,$(DEXPREOPT_BOOT_JARS)) |
Brian Carlstrom | f3b3bf1 | 2013-06-25 23:28:49 -0700 | [diff] [blame] | 87 | TARGET_BOOT_JARS := $(foreach jar,$(TARGET_BOOT_JARS),$(patsubst core, core-libart,$(jar))) |
Brian Carlstrom | a004aa9 | 2012-02-08 18:05:09 -0800 | [diff] [blame] | 88 | TARGET_BOOT_DEX_LOCATIONS := $(foreach jar,$(TARGET_BOOT_JARS),/$(DEXPREOPT_BOOT_JAR_DIR)/$(jar).jar) |
| 89 | TARGET_BOOT_DEX_FILES := $(foreach jar,$(TARGET_BOOT_JARS),$(call intermediates-dir-for,JAVA_LIBRARIES,$(jar),,COMMON)/javalib.jar) |
Brian Carlstrom | 04941d9 | 2012-02-19 01:47:51 -0800 | [diff] [blame] | 90 | |
| 91 | TARGET_BOOT_IMG_OUT := $(DEFAULT_DEX_PREOPT_IMAGE) |
| 92 | TARGET_BOOT_OAT_OUT := $(patsubst %.art,%.oat,$(TARGET_BOOT_IMG_OUT)) |
| 93 | TARGET_BOOT_OAT := $(subst $(PRODUCT_OUT),,$(TARGET_BOOT_OAT_OUT)) |
Brian Carlstrom | 265091e | 2013-01-30 14:08:26 -0800 | [diff] [blame] | 94 | TARGET_BOOT_OAT_UNSTRIPPED_OUT := $(TARGET_OUT_UNSTRIPPED)$(TARGET_BOOT_OAT) |
Brian Carlstrom | 1619286 | 2011-09-12 17:50:06 -0700 | [diff] [blame] | 95 | |
TDYa127 | 58e63f9 | 2012-04-24 13:16:47 -0700 | [diff] [blame] | 96 | $(TARGET_BOOT_IMG_OUT): $(TARGET_BOOT_DEX_FILES) $(DEX2OAT_DEPENDENCY) |
Shih-wei Liao | 8cfa882 | 2012-04-21 01:54:10 -0700 | [diff] [blame] | 97 | @echo "target dex2oat: $@ ($?)" |
| 98 | @mkdir -p $(dir $@) |
Brian Carlstrom | 265091e | 2013-01-30 14:08:26 -0800 | [diff] [blame] | 99 | @mkdir -p $(dir $(TARGET_BOOT_OAT_UNSTRIPPED_OUT)) |
Brian Carlstrom | 3f47c12 | 2013-03-07 00:02:40 -0800 | [diff] [blame] | 100 | $(hide) $(DEX2OAT) $(PARALLEL_ART_COMPILE_JOBS) --runtime-arg -Xms256m --runtime-arg -Xmx256m --image-classes=$(PRELOADED_CLASSES) $(addprefix --dex-file=,$(TARGET_BOOT_DEX_FILES)) $(addprefix --dex-location=,$(TARGET_BOOT_DEX_LOCATIONS)) --oat-symbols=$(TARGET_BOOT_OAT_UNSTRIPPED_OUT) --oat-file=$(TARGET_BOOT_OAT_OUT) --oat-location=$(TARGET_BOOT_OAT) --image=$(TARGET_BOOT_IMG_OUT) --base=$(IMG_TARGET_BASE_ADDRESS) --instruction-set=$(TARGET_ARCH) --host-prefix=$(PRODUCT_OUT) --android-root=$(PRODUCT_OUT)/system |
Brian Carlstrom | b8233d1 | 2011-10-13 11:40:38 -0700 | [diff] [blame] | 101 | |
Brian Carlstrom | 265091e | 2013-01-30 14:08:26 -0800 | [diff] [blame] | 102 | $(TARGET_BOOT_OAT_UNSTRIPPED_OUT): $(TARGET_BOOT_IMG_OUT) |
Brian Carlstrom | 29e7ac7 | 2011-12-05 23:42:57 -0800 | [diff] [blame] | 103 | |
Brian Carlstrom | 265091e | 2013-01-30 14:08:26 -0800 | [diff] [blame] | 104 | $(TARGET_BOOT_OAT_OUT): $(TARGET_BOOT_OAT_UNSTRIPPED_OUT) |
| 105 | |
| 106 | ifeq ($(ART_BUILD_TARGET_NDEBUG),true) |
Brian Carlstrom | 29e7ac7 | 2011-12-05 23:42:57 -0800 | [diff] [blame] | 107 | include $(CLEAR_VARS) |
| 108 | LOCAL_MODULE := boot.art |
| 109 | LOCAL_MODULE_TAGS := optional |
Brian Carlstrom | 51c2467 | 2013-07-11 16:00:56 -0700 | [diff] [blame^] | 110 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/build/Android.common.mk |
| 111 | LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/build/Android.oat.mk |
| 112 | LOCAL_ADDITIONAL_DEPENDENCIES += $(TARGET_BOOT_IMG_OUT) $(TARGET_BOOT_OAT_OUT) |
Brian Carlstrom | 29e7ac7 | 2011-12-05 23:42:57 -0800 | [diff] [blame] | 113 | include $(BUILD_PHONY_PACKAGE) |
Brian Carlstrom | cb91f1a | 2013-02-01 12:55:09 -0800 | [diff] [blame] | 114 | endif |