blob: 25d10bd006efa5749fff3d920e06bf38b34d8dc7 [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
Brian Carlstrom7940e442013-07-12 13:46:57 -070024ifeq ($(ART_BUILD_TARGET_NDEBUG),true)
Andreas Gampe54fc26c2014-09-04 21:47:42 -070025 $(eval $(call build-art-executable,oatdump,$(OATDUMP_SRC_FILES),libcutils libart-disassembler libart-compiler,art/disassembler art/compiler,target,ndebug))
Brian Carlstrom7940e442013-07-12 13:46:57 -070026endif
27ifeq ($(ART_BUILD_TARGET_DEBUG),true)
Andreas Gampe54fc26c2014-09-04 21:47:42 -070028 $(eval $(call build-art-executable,oatdump,$(OATDUMP_SRC_FILES),libcutils libartd-disassembler libart-compiler,art/disassembler art/compiler,target,debug))
Brian Carlstrom7940e442013-07-12 13:46:57 -070029endif
30
Ian Rogersc5f17732014-06-05 20:48:42 -070031ifeq ($(ART_BUILD_HOST_NDEBUG),true)
Andreas Gampe54fc26c2014-09-04 21:47:42 -070032 $(eval $(call build-art-executable,oatdump,$(OATDUMP_SRC_FILES),libart-disassembler libart-compiler,art/disassembler art/compiler,host,ndebug))
Ian Rogersc5f17732014-06-05 20:48:42 -070033endif
34ifeq ($(ART_BUILD_HOST_DEBUG),true)
Andreas Gampe54fc26c2014-09-04 21:47:42 -070035 $(eval $(call build-art-executable,oatdump,$(OATDUMP_SRC_FILES),libartd-disassembler libart-compiler,art/disassembler art/compiler,host,debug))
Brian Carlstrom7940e442013-07-12 13:46:57 -070036endif
Ian Rogersafd9acc2014-06-17 08:21:54 -070037
38########################################################################
39# oatdump targets
40
41ART_DUMP_OAT_PATH ?= $(OUT_DIR)
42
43OATDUMP := $(HOST_OUT_EXECUTABLES)/oatdump$(HOST_EXECUTABLE_SUFFIX)
44OATDUMPD := $(HOST_OUT_EXECUTABLES)/oatdumpd$(HOST_EXECUTABLE_SUFFIX)
45# TODO: for now, override with debug version for better error reporting
46OATDUMP := $(OATDUMPD)
47
48.PHONY: dump-oat
49dump-oat: dump-oat-core dump-oat-boot
50
51.PHONY: dump-oat-core
52dump-oat-core: dump-oat-core-host dump-oat-core-target
53
54.PHONY: dump-oat-core-host
55ifeq ($(ART_BUILD_HOST),true)
56dump-oat-core-host: $(HOST_CORE_IMG_OUT) $(OATDUMP)
57 $(OATDUMP) --image=$(HOST_CORE_IMG_LOCATION) --output=$(ART_DUMP_OAT_PATH)/core.host.oatdump.txt
58 @echo Output in $(ART_DUMP_OAT_PATH)/core.host.oatdump.txt
59endif
60
61.PHONY: dump-oat-core-target
62ifeq ($(ART_BUILD_TARGET),true)
63dump-oat-core-target: $(TARGET_CORE_IMG_OUT) $(OATDUMP)
64 $(OATDUMP) --image=$(TARGET_CORE_IMG_LOCATION) \
65 --output=$(ART_DUMP_OAT_PATH)/core.target.oatdump.txt --instruction-set=$(TARGET_ARCH)
66 @echo Output in $(ART_DUMP_OAT_PATH)/core.target.oatdump.txt
67endif
68
69.PHONY: dump-oat-boot-$(TARGET_ARCH)
70ifeq ($(ART_BUILD_TARGET_NDEBUG),true)
71dump-oat-boot-$(TARGET_ARCH): $(DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME) $(OATDUMP)
72 $(OATDUMP) --image=$(DEFAULT_DEX_PREOPT_BUILT_IMAGE_LOCATION) \
73 --output=$(ART_DUMP_OAT_PATH)/boot.$(TARGET_ARCH).oatdump.txt --instruction-set=$(TARGET_ARCH)
74 @echo Output in $(ART_DUMP_OAT_PATH)/boot.$(TARGET_ARCH).oatdump.txt
75endif
76
77ifdef TARGET_2ND_ARCH
78dump-oat-boot-$(TARGET_2ND_ARCH): $(2ND_DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME) $(OATDUMP)
79 $(OATDUMP) --image=$(2ND_DEFAULT_DEX_PREOPT_BUILT_IMAGE_LOCATION) \
80 --output=$(ART_DUMP_OAT_PATH)/boot.$(TARGET_2ND_ARCH).oatdump.txt --instruction-set=$(TARGET_2ND_ARCH)
81 @echo Output in $(ART_DUMP_OAT_PATH)/boot.$(TARGET_2ND_ARCH).oatdump.txt
82endif
83
84.PHONY: dump-oat-boot
85dump-oat-boot: dump-oat-boot-$(TARGET_ARCH)
86ifdef TARGET_2ND_ARCH
87dump-oat-boot: dump-oat-boot-$(TARGET_2ND_ARCH)
88endif
89
90.PHONY: dump-oat-Calculator
91ifeq ($(ART_BUILD_TARGET_NDEBUG),true)
92dump-oat-Calculator: $(TARGET_OUT_APPS)/Calculator.odex $(DEFAULT_DEX_PREOPT_BUILT_IMAGE) $(OATDUMP)
93 $(OATDUMP) --oat-file=$< --output=$(ART_DUMP_OAT_PATH)/Calculator.oatdump.txt
94 @echo Output in $(ART_DUMP_OAT_PATH)/Calculator.oatdump.txt
95endif