1# Copyright (C) 2011 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#      http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15LOCAL_PATH:= $(call my-dir)
16
17include $(LOCAL_PATH)/../common.mk
18
19common_src := common_option.cpp
20
21common_libs := \
22	liboprofile_pp \
23	liboprofile_db \
24	liboprofile_op_regex \
25	liboprofile_opt++ \
26	liboprofile_util++ \
27	liboprofile_popt \
28	liboprofile_op \
29	liboprofile_util \
30	libbfd \
31	libiberty \
32	libintl
33
34common_ldlibs := -lz $(common_host_ldlibs_libiconv) -ldl
35
36ifeq ($(HAVE_LIBBFD),true)
37
38# Build opreport on host
39include $(CLEAR_VARS)
40
41LOCAL_SRC_FILES:= \
42	$(common_src) \
43	opreport.cpp \
44	opreport_options.cpp
45
46LOCAL_STATIC_LIBRARIES := $(common_libs)
47LOCAL_C_INCLUDES := $(common_host_c_includes)
48LOCAL_CFLAGS := $(common_host_cflags)
49LOCAL_LDLIBS := $(common_ldlibs)
50LOCAL_MODULE_TAGS := optional
51LOCAL_MODULE:= opreport
52
53include $(BUILD_HOST_EXECUTABLE)
54
55# Build opannotate on host
56include $(CLEAR_VARS)
57
58LOCAL_SRC_FILES:= \
59	$(common_src) \
60	opannotate.cpp \
61	opannotate_options.cpp
62
63LOCAL_STATIC_LIBRARIES := $(common_libs)
64LOCAL_C_INCLUDES := $(common_host_c_includes)
65LOCAL_CFLAGS := $(common_host_cflags) $(common_host_extra_flags)
66LOCAL_LDLIBS := $(common_ldlibs)
67LOCAL_MODULE_TAGS := optional
68LOCAL_MODULE:= opannotate
69
70include $(BUILD_HOST_EXECUTABLE)
71
72# Build opgprof
73include $(CLEAR_VARS)
74
75LOCAL_SRC_FILES:= \
76	$(common_src) \
77	opgprof.cpp \
78	opgprof_options.cpp
79
80LOCAL_STATIC_LIBRARIES := $(common_libs)
81LOCAL_C_INCLUDES := $(common_host_c_includes)
82LOCAL_CFLAGS := $(common_host_cflags)
83LOCAL_LDLIBS := $(common_ldlibs)
84LOCAL_MODULE_TAGS := optional
85LOCAL_MODULE:= opgprof
86
87include $(BUILD_HOST_EXECUTABLE)
88
89# Build oparchive
90include $(CLEAR_VARS)
91
92LOCAL_SRC_FILES:= \
93	$(common_src) \
94	oparchive.cpp \
95	oparchive_options.cpp
96
97LOCAL_STATIC_LIBRARIES := $(common_libs)
98LOCAL_C_INCLUDES := $(common_host_c_includes)
99LOCAL_CFLAGS := $(common_host_cflags)
100LOCAL_LDLIBS := $(common_ldlibs)
101LOCAL_MODULE_TAGS := optional
102LOCAL_MODULE:= oparchive
103
104include $(BUILD_HOST_EXECUTABLE)
105
106endif
107