blob: f01afc541d1ba26c9af90f42e6f103241e784c14 [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
Ian Rogersafd9acc2014-06-17 08:21:54 -070019include art/build/Android.executable.mk
20
Brian Carlstrom7940e442013-07-12 13:46:57 -070021OATDUMP_SRC_FILES := \
22 oatdump.cc
23
Igor Murashkin37743352014-11-13 14:38:00 -080024# Build variants {target,host} x {debug,ndebug}
25$(eval $(call build-art-multi-executable,oatdump,$(OATDUMP_SRC_FILES),libart-compiler libart-disassembler,libcutils,,art/compiler art/disassembler))
Ian Rogersafd9acc2014-06-17 08:21:54 -070026
27########################################################################
28# oatdump targets
29
30ART_DUMP_OAT_PATH ?= $(OUT_DIR)
31
32OATDUMP := $(HOST_OUT_EXECUTABLES)/oatdump$(HOST_EXECUTABLE_SUFFIX)
33OATDUMPD := $(HOST_OUT_EXECUTABLES)/oatdumpd$(HOST_EXECUTABLE_SUFFIX)
34# TODO: for now, override with debug version for better error reporting
35OATDUMP := $(OATDUMPD)
36
37.PHONY: dump-oat
38dump-oat: dump-oat-core dump-oat-boot
39
40.PHONY: dump-oat-core
41dump-oat-core: dump-oat-core-host dump-oat-core-target
42
43.PHONY: dump-oat-core-host
44ifeq ($(ART_BUILD_HOST),true)
Ian Rogers13407c52014-11-07 16:55:45 -080045dump-oat-core-host: $(HOST_CORE_IMG_OUTS) $(OATDUMP)
Ian Rogersafd9acc2014-06-17 08:21:54 -070046 $(OATDUMP) --image=$(HOST_CORE_IMG_LOCATION) --output=$(ART_DUMP_OAT_PATH)/core.host.oatdump.txt
47 @echo Output in $(ART_DUMP_OAT_PATH)/core.host.oatdump.txt
48endif
49
50.PHONY: dump-oat-core-target
51ifeq ($(ART_BUILD_TARGET),true)
Ian Rogers13407c52014-11-07 16:55:45 -080052dump-oat-core-target: $(TARGET_CORE_IMAGE_default_no-pic_32) $(OATDUMP)
Ian Rogersafd9acc2014-06-17 08:21:54 -070053 $(OATDUMP) --image=$(TARGET_CORE_IMG_LOCATION) \
54 --output=$(ART_DUMP_OAT_PATH)/core.target.oatdump.txt --instruction-set=$(TARGET_ARCH)
55 @echo Output in $(ART_DUMP_OAT_PATH)/core.target.oatdump.txt
56endif
57
58.PHONY: dump-oat-boot-$(TARGET_ARCH)
59ifeq ($(ART_BUILD_TARGET_NDEBUG),true)
60dump-oat-boot-$(TARGET_ARCH): $(DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME) $(OATDUMP)
61 $(OATDUMP) --image=$(DEFAULT_DEX_PREOPT_BUILT_IMAGE_LOCATION) \
62 --output=$(ART_DUMP_OAT_PATH)/boot.$(TARGET_ARCH).oatdump.txt --instruction-set=$(TARGET_ARCH)
63 @echo Output in $(ART_DUMP_OAT_PATH)/boot.$(TARGET_ARCH).oatdump.txt
64endif
65
66ifdef TARGET_2ND_ARCH
67dump-oat-boot-$(TARGET_2ND_ARCH): $(2ND_DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME) $(OATDUMP)
68 $(OATDUMP) --image=$(2ND_DEFAULT_DEX_PREOPT_BUILT_IMAGE_LOCATION) \
69 --output=$(ART_DUMP_OAT_PATH)/boot.$(TARGET_2ND_ARCH).oatdump.txt --instruction-set=$(TARGET_2ND_ARCH)
70 @echo Output in $(ART_DUMP_OAT_PATH)/boot.$(TARGET_2ND_ARCH).oatdump.txt
71endif
72
73.PHONY: dump-oat-boot
74dump-oat-boot: dump-oat-boot-$(TARGET_ARCH)
75ifdef TARGET_2ND_ARCH
76dump-oat-boot: dump-oat-boot-$(TARGET_2ND_ARCH)
77endif
78
79.PHONY: dump-oat-Calculator
80ifeq ($(ART_BUILD_TARGET_NDEBUG),true)
81dump-oat-Calculator: $(TARGET_OUT_APPS)/Calculator.odex $(DEFAULT_DEX_PREOPT_BUILT_IMAGE) $(OATDUMP)
82 $(OATDUMP) --oat-file=$< --output=$(ART_DUMP_OAT_PATH)/Calculator.oatdump.txt
83 @echo Output in $(ART_DUMP_OAT_PATH)/Calculator.oatdump.txt
84endif