Home | History | Annotate | Download | only in libdwfl
      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 
     15 LOCAL_PATH := $(call my-dir)
     16 
     17 supported_platforms := linux-x86 darwin-x86
     18 cur_platform := $(filter $(HOST_OS)-$(HOST_ARCH),$(supported_platforms))
     19 
     20 ifdef cur_platform
     21 
     22 #
     23 # host libdwfl
     24 #
     25 
     26 include $(CLEAR_VARS)
     27 
     28 LIBDWFL_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 
     45 LOCAL_SRC_FILES := $(LIBDWFL_SRC_FILES)
     46 
     47 LOCAL_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 
     55 LOCAL_C_INCLUDES += $(LOCAL_PATH)/../host-$(HOST_OS)-fixup
     56 
     57 LOCAL_CFLAGS += -DHAVE_CONFIG_H -std=gnu99 -D_GNU_SOURCE
     58 
     59 # to suppress the "pointer of type void * used in arithmetic" warning
     60 LOCAL_CFLAGS += -Wno-pointer-arith
     61 
     62 ifeq ($(HOST_OS),darwin)
     63 	LOCAL_CFLAGS += -fnested-functions
     64 endif
     65 
     66 # to fix machine-dependent issues
     67 LOCAL_CFLAGS += -include $(LOCAL_PATH)/../host-$(HOST_OS)-fixup/AndroidFixup.h
     68 
     69 LOCAL_MODULE_TAGS := eng
     70 
     71 LOCAL_MODULE:= libdwfl
     72 
     73 include $(BUILD_HOST_STATIC_LIBRARY)
     74 
     75 #
     76 # target libdwfl
     77 #
     78 
     79 include $(CLEAR_VARS)
     80 
     81 LOCAL_SRC_FILES := $(LIBDWFL_SRC_FILES)
     82 
     83 LOCAL_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 
     92 LOCAL_C_INCLUDES += $(LOCAL_PATH)/../bionic-fixup
     93 
     94 LOCAL_CFLAGS += -include $(LOCAL_PATH)/../bionic-fixup/AndroidFixup.h
     95 
     96 LOCAL_CFLAGS += -DHAVE_CONFIG_H -std=gnu99 -Werror
     97 
     98 # to suppress the "pointer of type void * used in arithmetic" warning
     99 LOCAL_CFLAGS += -Wno-pointer-arith
    100 
    101 LOCAL_MODULE_TAGS := eng
    102 
    103 LOCAL_MODULE:= libdwfl
    104 
    105 include $(BUILD_STATIC_LIBRARY)
    106 
    107 endif #cur_platform
    108