blob: cdb7349b80dbbeb3424b89ad5136302384af206e [file] [log] [blame]
Brian Carlstrom16192862011-09-12 17:50:06 -07001#
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 Carlstrom04941d92012-02-19 01:47:51 -080017# DEX2OAT defined in build/core/config.mk
Brian Carlstrom16192862011-09-12 17:50:06 -070018DEX2OATD := $(HOST_OUT_EXECUTABLES)/dex2oatd$(HOST_EXECUTABLE_SUFFIX)
19# TODO: for now, override with debug version for better error reporting
20DEX2OAT := $(DEX2OATD)
21
Brian Carlstromd0b3a302012-04-04 22:29:06 -070022DEX2OAT_DEPENDENCY := | $(DEX2OAT) # by default, do not run rerun dex2oat if the tool changes
23# DEX2OAT_DEPENDENCY := $(DEX2OAT) # uncomment to force dex2oat to rerun on after all changes
Brian Carlstrom03a20ba2011-10-13 10:24:13 -070024
Brian Carlstrom78128a62011-09-15 17:21:19 -070025OATDUMP := $(HOST_OUT_EXECUTABLES)/oatdump$(HOST_EXECUTABLE_SUFFIX)
26OATDUMPD := $(HOST_OUT_EXECUTABLES)/oatdumpd$(HOST_EXECUTABLE_SUFFIX)
27# TODO: for now, override with debug version for better error reporting
28OATDUMP := $(OATDUMPD)
29
Brian Carlstrome24fa612011-09-29 00:53:55 -070030# start of image reserved address space
31IMG_HOST_BASE_ADDRESS := 0x60000000
32IMG_TARGET_BASE_ADDRESS := 0x60000000
Brian Carlstrom16192862011-09-12 17:50:06 -070033
Brian Carlstromae826982011-11-09 01:33:42 -080034PRELOADED_CLASSES := frameworks/base/preloaded-classes
35
Brian Carlstrom27ec9612011-09-19 20:20:38 -070036########################################################################
37# A smaller libcore only oat file
Brian Carlstrom87587cb2012-03-08 11:42:50 -080038TARGET_CORE_JARS := core core-junit bouncycastle
39HOST_CORE_JARS := $(addsuffix -hostdex,$(TARGET_CORE_JARS))
Brian Carlstrom16192862011-09-12 17:50:06 -070040
Brian Carlstroma004aa92012-02-08 18:05:09 -080041HOST_CORE_DEX_LOCATIONS := $(foreach jar,$(HOST_CORE_JARS), $(HOST_OUT_JAVA_LIBRARIES)/$(jar).jar)
42TARGET_CORE_DEX_LOCATIONS := $(foreach jar,$(TARGET_CORE_JARS),/$(DEXPREOPT_BOOT_JAR_DIR)/$(jar).jar)
43
44HOST_CORE_DEX_FILES := $(foreach jar,$(HOST_CORE_JARS), $(call intermediates-dir-for,JAVA_LIBRARIES,$(jar),t,COMMON)/javalib.jar)
45TARGET_CORE_DEX_FILES := $(foreach jar,$(TARGET_CORE_JARS),$(call intermediates-dir-for,JAVA_LIBRARIES,$(jar), ,COMMON)/javalib.jar)
Brian Carlstrom16192862011-09-12 17:50:06 -070046
Brian Carlstrom27ec9612011-09-19 20:20:38 -070047HOST_CORE_OAT := $(HOST_OUT_JAVA_LIBRARIES)/core.oat
Brian Carlstroma004aa92012-02-08 18:05:09 -080048TARGET_CORE_OAT := $(ART_TEST_DIR)/core.oat
Brian Carlstrom16192862011-09-12 17:50:06 -070049
Brian Carlstroma004aa92012-02-08 18:05:09 -080050HOST_CORE_OAT_OUT := $(HOST_OUT_JAVA_LIBRARIES)/core.oat
51TARGET_CORE_OAT_OUT := $(ART_TEST_OUT)/core.oat
Brian Carlstrome24fa612011-09-29 00:53:55 -070052
Brian Carlstroma004aa92012-02-08 18:05:09 -080053HOST_CORE_IMG_OUT := $(HOST_OUT_JAVA_LIBRARIES)/core.art
54TARGET_CORE_IMG_OUT := $(ART_TEST_OUT)/core.art
55
TDYa12758e63f92012-04-24 13:16:47 -070056$(HOST_CORE_IMG_OUT): $(HOST_CORE_DEX_FILES) $(DEX2OAT_DEPENDENCY)
Shih-wei Liao8cfa8822012-04-21 01:54:10 -070057 @echo "host dex2oat: $@ ($?)"
58 @mkdir -p $(dir $@)
jeffhao1f71ae82012-05-24 16:08:24 -070059 $(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)
Brian Carlstrom27ec9612011-09-19 20:20:38 -070060
Shih-wei Liao8cfa8822012-04-21 01:54:10 -070061$(TARGET_CORE_IMG_OUT): $(TARGET_CORE_DEX_FILES) $(DEX2OAT_DEPENDENCY)
62 @echo "target dex2oat: $@ ($?)"
63 @mkdir -p $(dir $@)
jeffhao1f71ae82012-05-24 16:08:24 -070064 $(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)
Brian Carlstrom27ec9612011-09-19 20:20:38 -070065
Brian Carlstrom73666be2012-03-10 20:25:10 -080066$(HOST_CORE_OAT_OUT): $(HOST_CORE_IMG_OUT)
Brian Carlstrom2b7cdf42011-10-13 11:18:28 -070067
Brian Carlstrom73666be2012-03-10 20:25:10 -080068$(TARGET_CORE_OAT_OUT): $(TARGET_CORE_IMG_OUT)
Brian Carlstrom2b7cdf42011-10-13 11:18:28 -070069
Brian Carlstrom85545cd2012-06-27 14:28:06 -070070include $(CLEAR_VARS)
71LOCAL_MODULE := core.art-host
72LOCAL_MODULE_TAGS := optional
73LOCAL_ADDITIONAL_DEPENDENCIES := $(HOST_CORE_IMG_OUT)
74include $(BUILD_PHONY_PACKAGE)
75
Brian Carlstrom27ec9612011-09-19 20:20:38 -070076########################################################################
77# The full system boot classpath
78TARGET_BOOT_JARS := $(subst :, ,$(DEXPREOPT_BOOT_JARS))
Brian Carlstroma004aa92012-02-08 18:05:09 -080079TARGET_BOOT_DEX_LOCATIONS := $(foreach jar,$(TARGET_BOOT_JARS),/$(DEXPREOPT_BOOT_JAR_DIR)/$(jar).jar)
80TARGET_BOOT_DEX_FILES := $(foreach jar,$(TARGET_BOOT_JARS),$(call intermediates-dir-for,JAVA_LIBRARIES,$(jar),,COMMON)/javalib.jar)
Brian Carlstrom04941d92012-02-19 01:47:51 -080081
82TARGET_BOOT_IMG_OUT := $(DEFAULT_DEX_PREOPT_IMAGE)
83TARGET_BOOT_OAT_OUT := $(patsubst %.art,%.oat,$(TARGET_BOOT_IMG_OUT))
84TARGET_BOOT_OAT := $(subst $(PRODUCT_OUT),,$(TARGET_BOOT_OAT_OUT))
Brian Carlstrom16192862011-09-12 17:50:06 -070085
TDYa12758e63f92012-04-24 13:16:47 -070086$(TARGET_BOOT_IMG_OUT): $(TARGET_BOOT_DEX_FILES) $(DEX2OAT_DEPENDENCY)
Shih-wei Liao8cfa8822012-04-21 01:54:10 -070087 @echo "target dex2oat: $@ ($?)"
88 @mkdir -p $(dir $@)
jeffhao1f71ae82012-05-24 16:08:24 -070089 $(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-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)
Brian Carlstromb8233d12011-10-13 11:40:38 -070090
Brian Carlstrom73666be2012-03-10 20:25:10 -080091$(TARGET_BOOT_OAT_OUT): $(TARGET_BOOT_IMG_OUT)
Brian Carlstrom29e7ac72011-12-05 23:42:57 -080092
93include $(CLEAR_VARS)
94LOCAL_MODULE := boot.art
95LOCAL_MODULE_TAGS := optional
Brian Carlstroma004aa92012-02-08 18:05:09 -080096LOCAL_ADDITIONAL_DEPENDENCIES := $(TARGET_BOOT_IMG_OUT)
Brian Carlstrom29e7ac72011-12-05 23:42:57 -080097include $(BUILD_PHONY_PACKAGE)