Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -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 | |
| 17 | LOCAL_PATH := $(call my-dir) |
| 18 | |
Colin Cross | 35235cb | 2016-09-09 11:19:32 -0700 | [diff] [blame] | 19 | ######################################################################## |
| 20 | # oatdump targets |
| 21 | |
| 22 | ART_DUMP_OAT_PATH ?= $(OUT_DIR) |
| 23 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 24 | OATDUMP := $(HOST_OUT_EXECUTABLES)/oatdump$(HOST_EXECUTABLE_SUFFIX) |
| 25 | OATDUMPD := $(HOST_OUT_EXECUTABLES)/oatdumpd$(HOST_EXECUTABLE_SUFFIX) |
| 26 | # TODO: for now, override with debug version for better error reporting |
| 27 | OATDUMP := $(OATDUMPD) |
| 28 | |
| 29 | .PHONY: dump-oat |
| 30 | dump-oat: dump-oat-core dump-oat-boot |
| 31 | |
| 32 | .PHONY: dump-oat-core |
| 33 | dump-oat-core: dump-oat-core-host dump-oat-core-target |
| 34 | |
| 35 | .PHONY: dump-oat-core-host |
| 36 | ifeq ($(ART_BUILD_HOST),true) |
Ian Rogers | 13407c5 | 2014-11-07 16:55:45 -0800 | [diff] [blame] | 37 | dump-oat-core-host: $(HOST_CORE_IMG_OUTS) $(OATDUMP) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 38 | $(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 |
| 40 | endif |
| 41 | |
Brian Carlstrom | ab00b7a | 2015-06-19 22:05:35 -0700 | [diff] [blame] | 42 | .PHONY: dump-oat-core-target-$(TARGET_ARCH) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 43 | ifeq ($(ART_BUILD_TARGET),true) |
Vladimir Marko | 83e2668 | 2017-12-05 17:58:57 +0000 | [diff] [blame] | 44 | dump-oat-core-target-$(TARGET_ARCH): $(TARGET_CORE_IMAGE_DEFAULT_$(ART_PHONY_TEST_TARGET_SUFFIX)) $(OATDUMP) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 45 | $(OATDUMP) --image=$(TARGET_CORE_IMG_LOCATION) \ |
Brian Carlstrom | ab00b7a | 2015-06-19 22:05:35 -0700 | [diff] [blame] | 46 | --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 |
| 48 | endif |
| 49 | |
| 50 | ifdef TARGET_2ND_ARCH |
| 51 | .PHONY: dump-oat-core-target-$(TARGET_2ND_ARCH) |
| 52 | ifeq ($(ART_BUILD_TARGET),true) |
Vladimir Marko | 83e2668 | 2017-12-05 17:58:57 +0000 | [diff] [blame] | 53 | dump-oat-core-target-$(TARGET_2ND_ARCH): $(TARGET_CORE_IMAGE_DEFAULT_$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)) $(OATDUMP) |
Brian Carlstrom | ab00b7a | 2015-06-19 22:05:35 -0700 | [diff] [blame] | 54 | $(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 |
| 57 | endif |
| 58 | endif |
| 59 | |
| 60 | .PHONY: dump-oat-core-target |
| 61 | dump-oat-core-target: dump-oat-core-target-$(TARGET_ARCH) |
| 62 | ifdef TARGET_2ND_ARCH |
| 63 | dump-oat-core-target: dump-oat-core-target-$(TARGET_2ND_ARCH) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 64 | endif |
| 65 | |
| 66 | .PHONY: dump-oat-boot-$(TARGET_ARCH) |
| 67 | ifeq ($(ART_BUILD_TARGET_NDEBUG),true) |
| 68 | dump-oat-boot-$(TARGET_ARCH): $(DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME) $(OATDUMP) |
Jeff Hao | dcdc85b | 2015-12-04 14:06:18 -0800 | [diff] [blame] | 69 | $(OATDUMP) $(addprefix --image=,$(DEFAULT_DEX_PREOPT_BUILT_IMAGE_LOCATION)) \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 70 | --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 |
| 72 | endif |
| 73 | |
| 74 | ifdef TARGET_2ND_ARCH |
| 75 | dump-oat-boot-$(TARGET_2ND_ARCH): $(2ND_DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME) $(OATDUMP) |
Jeff Hao | dcdc85b | 2015-12-04 14:06:18 -0800 | [diff] [blame] | 76 | $(OATDUMP) $(addprefix --image=,$(2ND_DEFAULT_DEX_PREOPT_BUILT_IMAGE_LOCATION)) \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 77 | --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 |
| 79 | endif |
| 80 | |
| 81 | .PHONY: dump-oat-boot |
| 82 | dump-oat-boot: dump-oat-boot-$(TARGET_ARCH) |
| 83 | ifdef TARGET_2ND_ARCH |
| 84 | dump-oat-boot: dump-oat-boot-$(TARGET_2ND_ARCH) |
| 85 | endif |