Richard Uhler | b730b78 | 2015-07-15 16:01:58 -0700 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2015 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 | |
Dan Willemsen | cd8a057 | 2016-09-16 17:11:36 -0700 | [diff] [blame] | 19 | include art/build/Android.common_path.mk |
Richard Uhler | 3524472 | 2015-09-10 16:45:54 -0700 | [diff] [blame] | 20 | |
Richard Uhler | b730b78 | 2015-07-15 16:01:58 -0700 | [diff] [blame] | 21 | # --- ahat.jar ---------------- |
| 22 | include $(CLEAR_VARS) |
| 23 | LOCAL_SRC_FILES := $(call all-java-files-under, src) |
| 24 | LOCAL_JAR_MANIFEST := src/manifest.txt |
| 25 | LOCAL_JAVA_RESOURCE_FILES := \ |
| 26 | $(LOCAL_PATH)/src/help.html \ |
| 27 | $(LOCAL_PATH)/src/style.css |
| 28 | |
| 29 | LOCAL_STATIC_JAVA_LIBRARIES := perflib-prebuilt guavalib trove-prebuilt |
| 30 | LOCAL_IS_HOST_MODULE := true |
| 31 | LOCAL_MODULE_TAGS := optional |
| 32 | LOCAL_MODULE := ahat |
Richard Uhler | 69272db | 2016-08-05 16:26:57 -0700 | [diff] [blame] | 33 | |
| 34 | # Let users with Java 7 run ahat (b/28303627) |
| 35 | LOCAL_JAVA_LANGUAGE_VERSION := 1.7 |
| 36 | |
Richard Uhler | b730b78 | 2015-07-15 16:01:58 -0700 | [diff] [blame] | 37 | include $(BUILD_HOST_JAVA_LIBRARY) |
| 38 | |
| 39 | # --- ahat script ---------------- |
| 40 | include $(CLEAR_VARS) |
| 41 | LOCAL_IS_HOST_MODULE := true |
Richard Uhler | b730b78 | 2015-07-15 16:01:58 -0700 | [diff] [blame] | 42 | LOCAL_MODULE_CLASS := EXECUTABLES |
| 43 | LOCAL_MODULE := ahat |
Dan Willemsen | fa8598d | 2016-02-29 21:09:08 -0800 | [diff] [blame] | 44 | LOCAL_SRC_FILES := ahat |
| 45 | include $(BUILD_PREBUILT) |
Richard Uhler | b730b78 | 2015-07-15 16:01:58 -0700 | [diff] [blame] | 46 | |
Richard Uhler | 3524472 | 2015-09-10 16:45:54 -0700 | [diff] [blame] | 47 | # --- ahat-tests.jar -------------- |
Richard Uhler | b730b78 | 2015-07-15 16:01:58 -0700 | [diff] [blame] | 48 | include $(CLEAR_VARS) |
| 49 | LOCAL_SRC_FILES := $(call all-java-files-under, test) |
| 50 | LOCAL_JAR_MANIFEST := test/manifest.txt |
| 51 | LOCAL_STATIC_JAVA_LIBRARIES := ahat junit |
| 52 | LOCAL_IS_HOST_MODULE := true |
| 53 | LOCAL_MODULE_TAGS := tests |
| 54 | LOCAL_MODULE := ahat-tests |
| 55 | include $(BUILD_HOST_JAVA_LIBRARY) |
Richard Uhler | 3524472 | 2015-09-10 16:45:54 -0700 | [diff] [blame] | 56 | AHAT_TEST_JAR := $(LOCAL_BUILT_MODULE) |
Richard Uhler | b730b78 | 2015-07-15 16:01:58 -0700 | [diff] [blame] | 57 | |
Richard Uhler | 3524472 | 2015-09-10 16:45:54 -0700 | [diff] [blame] | 58 | # --- ahat-test-dump.jar -------------- |
| 59 | include $(CLEAR_VARS) |
| 60 | LOCAL_MODULE := ahat-test-dump |
| 61 | LOCAL_MODULE_TAGS := tests |
| 62 | LOCAL_SRC_FILES := $(call all-java-files-under, test-dump) |
| 63 | include $(BUILD_HOST_DALVIK_JAVA_LIBRARY) |
| 64 | |
| 65 | # Determine the location of the test-dump.jar and test-dump.hprof files. |
| 66 | # These use variables set implicitly by the include of |
| 67 | # BUILD_HOST_DALVIK_JAVA_LIBRARY above. |
| 68 | AHAT_TEST_DUMP_JAR := $(LOCAL_BUILT_MODULE) |
| 69 | AHAT_TEST_DUMP_HPROF := $(intermediates.COMMON)/test-dump.hprof |
| 70 | |
| 71 | # Run ahat-test-dump.jar to generate test-dump.hprof |
| 72 | AHAT_TEST_DUMP_DEPENDENCIES := \ |
Richard Uhler | c5a0004 | 2016-07-01 13:10:56 -0700 | [diff] [blame] | 73 | $(ART_HOST_EXECUTABLES) \ |
| 74 | $(ART_HOST_SHARED_LIBRARY_DEPENDENCIES) \ |
| 75 | $(HOST_OUT_EXECUTABLES)/art \ |
Richard Uhler | 6928649 | 2016-09-20 10:41:47 +0100 | [diff] [blame^] | 76 | $(HOST_CORE_IMG_OUT_BASE)$(CORE_IMG_SUFFIX) |
Richard Uhler | 3524472 | 2015-09-10 16:45:54 -0700 | [diff] [blame] | 77 | |
| 78 | $(AHAT_TEST_DUMP_HPROF): PRIVATE_AHAT_TEST_ART := $(HOST_OUT_EXECUTABLES)/art |
| 79 | $(AHAT_TEST_DUMP_HPROF): PRIVATE_AHAT_TEST_DUMP_JAR := $(AHAT_TEST_DUMP_JAR) |
| 80 | $(AHAT_TEST_DUMP_HPROF): PRIVATE_AHAT_TEST_DUMP_DEPENDENCIES := $(AHAT_TEST_DUMP_DEPENDENCIES) |
| 81 | $(AHAT_TEST_DUMP_HPROF): $(AHAT_TEST_DUMP_JAR) $(AHAT_TEST_DUMP_DEPENDENCIES) |
| 82 | $(PRIVATE_AHAT_TEST_ART) -cp $(PRIVATE_AHAT_TEST_DUMP_JAR) Main $@ |
| 83 | |
| 84 | .PHONY: ahat-test |
| 85 | ahat-test: PRIVATE_AHAT_TEST_DUMP_HPROF := $(AHAT_TEST_DUMP_HPROF) |
| 86 | ahat-test: PRIVATE_AHAT_TEST_JAR := $(AHAT_TEST_JAR) |
| 87 | ahat-test: $(AHAT_TEST_JAR) $(AHAT_TEST_DUMP_HPROF) |
| 88 | java -Dahat.test.dump.hprof=$(PRIVATE_AHAT_TEST_DUMP_HPROF) -jar $(PRIVATE_AHAT_TEST_JAR) |
| 89 | |
| 90 | # Clean up local variables. |
| 91 | AHAT_TEST_DUMP_DEPENDENCIES := |
| 92 | AHAT_TEST_DUMP_HPROF := |
| 93 | AHAT_TEST_DUMP_JAR := |
| 94 | AHAT_TEST_JAR := |
| 95 | |