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 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 19 | include art/build/Android.executable.mk |
| 20 | |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 21 | OATDUMP_SRC_FILES := \ |
| 22 | oatdump.cc |
| 23 | |
Igor Murashkin | 3774335 | 2014-11-13 14:38:00 -0800 | [diff] [blame] | 24 | # 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 Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 26 | |
| 27 | ######################################################################## |
| 28 | # oatdump targets |
| 29 | |
| 30 | ART_DUMP_OAT_PATH ?= $(OUT_DIR) |
| 31 | |
| 32 | OATDUMP := $(HOST_OUT_EXECUTABLES)/oatdump$(HOST_EXECUTABLE_SUFFIX) |
| 33 | OATDUMPD := $(HOST_OUT_EXECUTABLES)/oatdumpd$(HOST_EXECUTABLE_SUFFIX) |
| 34 | # TODO: for now, override with debug version for better error reporting |
| 35 | OATDUMP := $(OATDUMPD) |
| 36 | |
| 37 | .PHONY: dump-oat |
| 38 | dump-oat: dump-oat-core dump-oat-boot |
| 39 | |
| 40 | .PHONY: dump-oat-core |
| 41 | dump-oat-core: dump-oat-core-host dump-oat-core-target |
| 42 | |
| 43 | .PHONY: dump-oat-core-host |
| 44 | ifeq ($(ART_BUILD_HOST),true) |
Ian Rogers | 13407c5 | 2014-11-07 16:55:45 -0800 | [diff] [blame] | 45 | dump-oat-core-host: $(HOST_CORE_IMG_OUTS) $(OATDUMP) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 46 | $(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 |
| 48 | endif |
| 49 | |
Brian Carlstrom | ab00b7a | 2015-06-19 22:05:35 -0700 | [diff] [blame] | 50 | .PHONY: dump-oat-core-target-$(TARGET_ARCH) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 51 | ifeq ($(ART_BUILD_TARGET),true) |
Brian Carlstrom | ab00b7a | 2015-06-19 22:05:35 -0700 | [diff] [blame] | 52 | dump-oat-core-target-$(TARGET_ARCH): $(TARGET_CORE_IMAGE_default_no-pic_$(ART_PHONY_TEST_TARGET_SUFFIX)) $(OATDUMP) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 53 | $(OATDUMP) --image=$(TARGET_CORE_IMG_LOCATION) \ |
Brian Carlstrom | ab00b7a | 2015-06-19 22:05:35 -0700 | [diff] [blame] | 54 | --output=$(ART_DUMP_OAT_PATH)/core.target.$(TARGET_ARCH).oatdump.txt --instruction-set=$(TARGET_ARCH) |
| 55 | @echo Output in $(ART_DUMP_OAT_PATH)/core.target.$(TARGET_ARCH).oatdump.txt |
| 56 | endif |
| 57 | |
| 58 | ifdef TARGET_2ND_ARCH |
| 59 | .PHONY: dump-oat-core-target-$(TARGET_2ND_ARCH) |
| 60 | ifeq ($(ART_BUILD_TARGET),true) |
| 61 | dump-oat-core-target-$(TARGET_2ND_ARCH): $(TARGET_CORE_IMAGE_default_no-pic_$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)) $(OATDUMP) |
| 62 | $(OATDUMP) --image=$(TARGET_CORE_IMG_LOCATION) \ |
| 63 | --output=$(ART_DUMP_OAT_PATH)/core.target.$(TARGET_2ND_ARCH).oatdump.txt --instruction-set=$(TARGET_2ND_ARCH) |
| 64 | @echo Output in $(ART_DUMP_OAT_PATH)/core.target.$(TARGET_2ND_ARCH).oatdump.txt |
| 65 | endif |
| 66 | endif |
| 67 | |
| 68 | .PHONY: dump-oat-core-target |
| 69 | dump-oat-core-target: dump-oat-core-target-$(TARGET_ARCH) |
| 70 | ifdef TARGET_2ND_ARCH |
| 71 | dump-oat-core-target: dump-oat-core-target-$(TARGET_2ND_ARCH) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 72 | endif |
| 73 | |
| 74 | .PHONY: dump-oat-boot-$(TARGET_ARCH) |
| 75 | ifeq ($(ART_BUILD_TARGET_NDEBUG),true) |
| 76 | dump-oat-boot-$(TARGET_ARCH): $(DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME) $(OATDUMP) |
Jeff Hao | dcdc85b | 2015-12-04 14:06:18 -0800 | [diff] [blame] | 77 | $(OATDUMP) $(addprefix --image=,$(DEFAULT_DEX_PREOPT_BUILT_IMAGE_LOCATION)) \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 78 | --output=$(ART_DUMP_OAT_PATH)/boot.$(TARGET_ARCH).oatdump.txt --instruction-set=$(TARGET_ARCH) |
| 79 | @echo Output in $(ART_DUMP_OAT_PATH)/boot.$(TARGET_ARCH).oatdump.txt |
| 80 | endif |
| 81 | |
| 82 | ifdef TARGET_2ND_ARCH |
| 83 | 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] | 84 | $(OATDUMP) $(addprefix --image=,$(2ND_DEFAULT_DEX_PREOPT_BUILT_IMAGE_LOCATION)) \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 85 | --output=$(ART_DUMP_OAT_PATH)/boot.$(TARGET_2ND_ARCH).oatdump.txt --instruction-set=$(TARGET_2ND_ARCH) |
| 86 | @echo Output in $(ART_DUMP_OAT_PATH)/boot.$(TARGET_2ND_ARCH).oatdump.txt |
| 87 | endif |
| 88 | |
| 89 | .PHONY: dump-oat-boot |
| 90 | dump-oat-boot: dump-oat-boot-$(TARGET_ARCH) |
| 91 | ifdef TARGET_2ND_ARCH |
| 92 | dump-oat-boot: dump-oat-boot-$(TARGET_2ND_ARCH) |
| 93 | endif |
| 94 | |
| 95 | .PHONY: dump-oat-Calculator |
| 96 | ifeq ($(ART_BUILD_TARGET_NDEBUG),true) |
| 97 | dump-oat-Calculator: $(TARGET_OUT_APPS)/Calculator.odex $(DEFAULT_DEX_PREOPT_BUILT_IMAGE) $(OATDUMP) |
| 98 | $(OATDUMP) --oat-file=$< --output=$(ART_DUMP_OAT_PATH)/Calculator.oatdump.txt |
| 99 | @echo Output in $(ART_DUMP_OAT_PATH)/Calculator.oatdump.txt |
| 100 | endif |