blob: 667c37c33dc70d07cc8df4c8504d115bef49e663 [file] [log] [blame]
Brian Carlstrom7940e442013-07-12 13:46:57 -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
17LOCAL_PATH := $(call my-dir)
18
Colin Cross35235cb2016-09-09 11:19:32 -070019########################################################################
20# oatdump targets
21
22ART_DUMP_OAT_PATH ?= $(OUT_DIR)
23
Ian Rogersafd9acc2014-06-17 08:21:54 -070024OATDUMP := $(HOST_OUT_EXECUTABLES)/oatdump$(HOST_EXECUTABLE_SUFFIX)
25OATDUMPD := $(HOST_OUT_EXECUTABLES)/oatdumpd$(HOST_EXECUTABLE_SUFFIX)
26# TODO: for now, override with debug version for better error reporting
27OATDUMP := $(OATDUMPD)
28
29.PHONY: dump-oat
30dump-oat: dump-oat-core dump-oat-boot
31
32.PHONY: dump-oat-core
33dump-oat-core: dump-oat-core-host dump-oat-core-target
34
35.PHONY: dump-oat-core-host
36ifeq ($(ART_BUILD_HOST),true)
Ian Rogers13407c52014-11-07 16:55:45 -080037dump-oat-core-host: $(HOST_CORE_IMG_OUTS) $(OATDUMP)
Ian Rogersafd9acc2014-06-17 08:21:54 -070038 $(OATDUMP) --image=$(HOST_CORE_IMG_LOCATION) --output=$(ART_DUMP_OAT_PATH)/core.host.oatdump.txt
39 @echo Output in $(ART_DUMP_OAT_PATH)/core.host.oatdump.txt
40endif
41
Brian Carlstromab00b7a2015-06-19 22:05:35 -070042.PHONY: dump-oat-core-target-$(TARGET_ARCH)
Ian Rogersafd9acc2014-06-17 08:21:54 -070043ifeq ($(ART_BUILD_TARGET),true)
Vladimir Marko83e26682017-12-05 17:58:57 +000044dump-oat-core-target-$(TARGET_ARCH): $(TARGET_CORE_IMAGE_DEFAULT_$(ART_PHONY_TEST_TARGET_SUFFIX)) $(OATDUMP)
Ian Rogersafd9acc2014-06-17 08:21:54 -070045 $(OATDUMP) --image=$(TARGET_CORE_IMG_LOCATION) \
Brian Carlstromab00b7a2015-06-19 22:05:35 -070046 --output=$(ART_DUMP_OAT_PATH)/core.target.$(TARGET_ARCH).oatdump.txt --instruction-set=$(TARGET_ARCH)
47 @echo Output in $(ART_DUMP_OAT_PATH)/core.target.$(TARGET_ARCH).oatdump.txt
48endif
49
50ifdef TARGET_2ND_ARCH
51.PHONY: dump-oat-core-target-$(TARGET_2ND_ARCH)
52ifeq ($(ART_BUILD_TARGET),true)
Vladimir Marko83e26682017-12-05 17:58:57 +000053dump-oat-core-target-$(TARGET_2ND_ARCH): $(TARGET_CORE_IMAGE_DEFAULT_$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)) $(OATDUMP)
Brian Carlstromab00b7a2015-06-19 22:05:35 -070054 $(OATDUMP) --image=$(TARGET_CORE_IMG_LOCATION) \
55 --output=$(ART_DUMP_OAT_PATH)/core.target.$(TARGET_2ND_ARCH).oatdump.txt --instruction-set=$(TARGET_2ND_ARCH)
56 @echo Output in $(ART_DUMP_OAT_PATH)/core.target.$(TARGET_2ND_ARCH).oatdump.txt
57endif
58endif
59
60.PHONY: dump-oat-core-target
61dump-oat-core-target: dump-oat-core-target-$(TARGET_ARCH)
62ifdef TARGET_2ND_ARCH
63dump-oat-core-target: dump-oat-core-target-$(TARGET_2ND_ARCH)
Ian Rogersafd9acc2014-06-17 08:21:54 -070064endif
65
66.PHONY: dump-oat-boot-$(TARGET_ARCH)
67ifeq ($(ART_BUILD_TARGET_NDEBUG),true)
68dump-oat-boot-$(TARGET_ARCH): $(DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME) $(OATDUMP)
Jeff Haodcdc85b2015-12-04 14:06:18 -080069 $(OATDUMP) $(addprefix --image=,$(DEFAULT_DEX_PREOPT_BUILT_IMAGE_LOCATION)) \
Ian Rogersafd9acc2014-06-17 08:21:54 -070070 --output=$(ART_DUMP_OAT_PATH)/boot.$(TARGET_ARCH).oatdump.txt --instruction-set=$(TARGET_ARCH)
71 @echo Output in $(ART_DUMP_OAT_PATH)/boot.$(TARGET_ARCH).oatdump.txt
72endif
73
74ifdef TARGET_2ND_ARCH
75dump-oat-boot-$(TARGET_2ND_ARCH): $(2ND_DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME) $(OATDUMP)
Jeff Haodcdc85b2015-12-04 14:06:18 -080076 $(OATDUMP) $(addprefix --image=,$(2ND_DEFAULT_DEX_PREOPT_BUILT_IMAGE_LOCATION)) \
Ian Rogersafd9acc2014-06-17 08:21:54 -070077 --output=$(ART_DUMP_OAT_PATH)/boot.$(TARGET_2ND_ARCH).oatdump.txt --instruction-set=$(TARGET_2ND_ARCH)
78 @echo Output in $(ART_DUMP_OAT_PATH)/boot.$(TARGET_2ND_ARCH).oatdump.txt
79endif
80
81.PHONY: dump-oat-boot
82dump-oat-boot: dump-oat-boot-$(TARGET_ARCH)
83ifdef TARGET_2ND_ARCH
84dump-oat-boot: dump-oat-boot-$(TARGET_2ND_ARCH)
85endif