1# Copyright (C) 2012 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
17supported_platforms := linux-x86 darwin-x86
18cur_platform := $(filter $(HOST_OS)-$(HOST_ARCH),$(supported_platforms))
19
20ifdef cur_platform
21
22#
23# host libdwfl
24#
25
26include $(CLEAR_VARS)
27
28LIBDWFL_SRC_FILES := \
29	dwfl_begin.c \
30	dwfl_build_id_find_elf.c \
31	dwfl_build_id_find_debuginfo.c \
32	libdwfl_crc32.c \
33	libdwfl_crc32_file.c \
34	dwfl_end.c \
35	dwfl_error.c \
36	dwfl_module.c \
37	dwfl_module_addrdie.c \
38	dwfl_module_build_id.c \
39	dwfl_module_getdwarf.c \
40	dwfl_report_elf.c \
41	find-debuginfo.c \
42	offline.c \
43	relocate.c
44
45LOCAL_SRC_FILES := $(LIBDWFL_SRC_FILES)
46
47LOCAL_C_INCLUDES := \
48	$(LOCAL_PATH)/.. \
49	$(LOCAL_PATH)/../lib \
50	$(LOCAL_PATH)/../libdwfl \
51	$(LOCAL_PATH)/../libebl \
52	$(LOCAL_PATH)/../libdw \
53	$(LOCAL_PATH)/../libelf
54
55LOCAL_C_INCLUDES += $(LOCAL_PATH)/../host-$(HOST_OS)-fixup
56
57LOCAL_CFLAGS += -DHAVE_CONFIG_H -std=gnu99 -D_GNU_SOURCE
58
59# to suppress the "pointer of type âvoid *â used in arithmetic" warning
60LOCAL_CFLAGS += -Wno-pointer-arith
61
62ifeq ($(HOST_OS),darwin)
63	LOCAL_CFLAGS += -fnested-functions
64endif
65
66# to fix machine-dependent issues
67LOCAL_CFLAGS += -include $(LOCAL_PATH)/../host-$(HOST_OS)-fixup/AndroidFixup.h
68
69LOCAL_MODULE_TAGS := eng
70
71LOCAL_MODULE:= libdwfl
72
73include $(BUILD_HOST_STATIC_LIBRARY)
74
75#
76# target libdwfl
77#
78
79include $(CLEAR_VARS)
80
81LOCAL_SRC_FILES := $(LIBDWFL_SRC_FILES)
82
83LOCAL_C_INCLUDES := \
84	$(LOCAL_PATH)/.. \
85	$(LOCAL_PATH)/../lib \
86	$(LOCAL_PATH)/../libdwfl \
87	$(LOCAL_PATH)/../libebl \
88	$(LOCAL_PATH)/../libdw \
89	$(LOCAL_PATH)/../libelf
90
91
92LOCAL_C_INCLUDES += $(LOCAL_PATH)/../bionic-fixup
93
94LOCAL_CFLAGS += -include $(LOCAL_PATH)/../bionic-fixup/AndroidFixup.h
95
96LOCAL_CFLAGS += -DHAVE_CONFIG_H -std=gnu99 -Werror
97
98# to suppress the "pointer of type âvoid *â used in arithmetic" warning
99LOCAL_CFLAGS += -Wno-pointer-arith
100
101LOCAL_MODULE_TAGS := eng
102
103LOCAL_MODULE:= libdwfl
104
105include $(BUILD_STATIC_LIBRARY)
106
107endif #cur_platform
108