blob: ebf087d859254c30679a08ec81bdab1ff2caa395 [file] [log] [blame]
Richard Uhlerb730b782015-07-15 16:01:58 -07001#
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
17LOCAL_PATH := $(call my-dir)
18
Dan Willemsencd8a0572016-09-16 17:11:36 -070019include art/build/Android.common_path.mk
Richard Uhler35244722015-09-10 16:45:54 -070020
Richard Uhlerb730b782015-07-15 16:01:58 -070021# --- ahat.jar ----------------
22include $(CLEAR_VARS)
23LOCAL_SRC_FILES := $(call all-java-files-under, src)
24LOCAL_JAR_MANIFEST := src/manifest.txt
25LOCAL_JAVA_RESOURCE_FILES := \
26 $(LOCAL_PATH)/src/help.html \
27 $(LOCAL_PATH)/src/style.css
28
29LOCAL_STATIC_JAVA_LIBRARIES := perflib-prebuilt guavalib trove-prebuilt
30LOCAL_IS_HOST_MODULE := true
31LOCAL_MODULE_TAGS := optional
32LOCAL_MODULE := ahat
Richard Uhler69272db2016-08-05 16:26:57 -070033
34# Let users with Java 7 run ahat (b/28303627)
35LOCAL_JAVA_LANGUAGE_VERSION := 1.7
36
Richard Uhlerb730b782015-07-15 16:01:58 -070037include $(BUILD_HOST_JAVA_LIBRARY)
38
39# --- ahat script ----------------
40include $(CLEAR_VARS)
41LOCAL_IS_HOST_MODULE := true
Richard Uhlerb730b782015-07-15 16:01:58 -070042LOCAL_MODULE_CLASS := EXECUTABLES
43LOCAL_MODULE := ahat
Dan Willemsenfa8598d2016-02-29 21:09:08 -080044LOCAL_SRC_FILES := ahat
45include $(BUILD_PREBUILT)
Richard Uhlerb730b782015-07-15 16:01:58 -070046
Richard Uhler35244722015-09-10 16:45:54 -070047# --- ahat-tests.jar --------------
Richard Uhlerb730b782015-07-15 16:01:58 -070048include $(CLEAR_VARS)
49LOCAL_SRC_FILES := $(call all-java-files-under, test)
50LOCAL_JAR_MANIFEST := test/manifest.txt
51LOCAL_STATIC_JAVA_LIBRARIES := ahat junit
52LOCAL_IS_HOST_MODULE := true
53LOCAL_MODULE_TAGS := tests
54LOCAL_MODULE := ahat-tests
55include $(BUILD_HOST_JAVA_LIBRARY)
Richard Uhler35244722015-09-10 16:45:54 -070056AHAT_TEST_JAR := $(LOCAL_BUILT_MODULE)
Richard Uhlerb730b782015-07-15 16:01:58 -070057
Richard Uhler35244722015-09-10 16:45:54 -070058# --- ahat-test-dump.jar --------------
59include $(CLEAR_VARS)
60LOCAL_MODULE := ahat-test-dump
61LOCAL_MODULE_TAGS := tests
62LOCAL_SRC_FILES := $(call all-java-files-under, test-dump)
63include $(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.
68AHAT_TEST_DUMP_JAR := $(LOCAL_BUILT_MODULE)
69AHAT_TEST_DUMP_HPROF := $(intermediates.COMMON)/test-dump.hprof
70
71# Run ahat-test-dump.jar to generate test-dump.hprof
72AHAT_TEST_DUMP_DEPENDENCIES := \
Richard Uhlerc5a00042016-07-01 13:10:56 -070073 $(ART_HOST_EXECUTABLES) \
74 $(ART_HOST_SHARED_LIBRARY_DEPENDENCIES) \
75 $(HOST_OUT_EXECUTABLES)/art \
Richard Uhler69286492016-09-20 10:41:47 +010076 $(HOST_CORE_IMG_OUT_BASE)$(CORE_IMG_SUFFIX)
Richard Uhler35244722015-09-10 16:45:54 -070077
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
85ahat-test: PRIVATE_AHAT_TEST_DUMP_HPROF := $(AHAT_TEST_DUMP_HPROF)
86ahat-test: PRIVATE_AHAT_TEST_JAR := $(AHAT_TEST_JAR)
87ahat-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.
91AHAT_TEST_DUMP_DEPENDENCIES :=
92AHAT_TEST_DUMP_HPROF :=
93AHAT_TEST_DUMP_JAR :=
94AHAT_TEST_JAR :=
95