• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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:= libdwfl
70
71include $(BUILD_HOST_STATIC_LIBRARY)
72
73#
74# target libdwfl
75#
76
77include $(CLEAR_VARS)
78
79LOCAL_SRC_FILES := $(LIBDWFL_SRC_FILES)
80
81LOCAL_C_INCLUDES := \
82	$(LOCAL_PATH)/.. \
83	$(LOCAL_PATH)/../lib \
84	$(LOCAL_PATH)/../libdwfl \
85	$(LOCAL_PATH)/../libebl \
86	$(LOCAL_PATH)/../libdw \
87	$(LOCAL_PATH)/../libelf
88
89
90LOCAL_C_INCLUDES += $(LOCAL_PATH)/../bionic-fixup
91
92LOCAL_CFLAGS += -include $(LOCAL_PATH)/../bionic-fixup/AndroidFixup.h
93
94LOCAL_CFLAGS += -DHAVE_CONFIG_H -std=gnu99 -Werror
95
96# to suppress the "pointer of type ‘void *’ used in arithmetic" warning
97LOCAL_CFLAGS += -Wno-pointer-arith
98
99LOCAL_MODULE:= libdwfl
100
101include $(BUILD_STATIC_LIBRARY)
102
103endif #cur_platform
104