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 | |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 24 | ifeq ($(ART_BUILD_TARGET_NDEBUG),true) |
Andreas Gampe | 54fc26c | 2014-09-04 21:47:42 -0700 | [diff] [blame^] | 25 | $(eval $(call build-art-executable,oatdump,$(OATDUMP_SRC_FILES),libcutils libart-disassembler libart-compiler,art/disassembler art/compiler,target,ndebug)) |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 26 | endif |
| 27 | ifeq ($(ART_BUILD_TARGET_DEBUG),true) |
Andreas Gampe | 54fc26c | 2014-09-04 21:47:42 -0700 | [diff] [blame^] | 28 | $(eval $(call build-art-executable,oatdump,$(OATDUMP_SRC_FILES),libcutils libartd-disassembler libart-compiler,art/disassembler art/compiler,target,debug)) |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 29 | endif |
| 30 | |
Ian Rogers | c5f1773 | 2014-06-05 20:48:42 -0700 | [diff] [blame] | 31 | ifeq ($(ART_BUILD_HOST_NDEBUG),true) |
Andreas Gampe | 54fc26c | 2014-09-04 21:47:42 -0700 | [diff] [blame^] | 32 | $(eval $(call build-art-executable,oatdump,$(OATDUMP_SRC_FILES),libart-disassembler libart-compiler,art/disassembler art/compiler,host,ndebug)) |
Ian Rogers | c5f1773 | 2014-06-05 20:48:42 -0700 | [diff] [blame] | 33 | endif |
| 34 | ifeq ($(ART_BUILD_HOST_DEBUG),true) |
Andreas Gampe | 54fc26c | 2014-09-04 21:47:42 -0700 | [diff] [blame^] | 35 | $(eval $(call build-art-executable,oatdump,$(OATDUMP_SRC_FILES),libartd-disassembler libart-compiler,art/disassembler art/compiler,host,debug)) |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 36 | endif |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 37 | |
| 38 | ######################################################################## |
| 39 | # oatdump targets |
| 40 | |
| 41 | ART_DUMP_OAT_PATH ?= $(OUT_DIR) |
| 42 | |
| 43 | OATDUMP := $(HOST_OUT_EXECUTABLES)/oatdump$(HOST_EXECUTABLE_SUFFIX) |
| 44 | OATDUMPD := $(HOST_OUT_EXECUTABLES)/oatdumpd$(HOST_EXECUTABLE_SUFFIX) |
| 45 | # TODO: for now, override with debug version for better error reporting |
| 46 | OATDUMP := $(OATDUMPD) |
| 47 | |
| 48 | .PHONY: dump-oat |
| 49 | dump-oat: dump-oat-core dump-oat-boot |
| 50 | |
| 51 | .PHONY: dump-oat-core |
| 52 | dump-oat-core: dump-oat-core-host dump-oat-core-target |
| 53 | |
| 54 | .PHONY: dump-oat-core-host |
| 55 | ifeq ($(ART_BUILD_HOST),true) |
| 56 | dump-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 |
| 59 | endif |
| 60 | |
| 61 | .PHONY: dump-oat-core-target |
| 62 | ifeq ($(ART_BUILD_TARGET),true) |
| 63 | dump-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 |
| 67 | endif |
| 68 | |
| 69 | .PHONY: dump-oat-boot-$(TARGET_ARCH) |
| 70 | ifeq ($(ART_BUILD_TARGET_NDEBUG),true) |
| 71 | dump-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 |
| 75 | endif |
| 76 | |
| 77 | ifdef TARGET_2ND_ARCH |
| 78 | dump-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 |
| 82 | endif |
| 83 | |
| 84 | .PHONY: dump-oat-boot |
| 85 | dump-oat-boot: dump-oat-boot-$(TARGET_ARCH) |
| 86 | ifdef TARGET_2ND_ARCH |
| 87 | dump-oat-boot: dump-oat-boot-$(TARGET_2ND_ARCH) |
| 88 | endif |
| 89 | |
| 90 | .PHONY: dump-oat-Calculator |
| 91 | ifeq ($(ART_BUILD_TARGET_NDEBUG),true) |
| 92 | dump-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 |
| 95 | endif |