Home | History | Annotate | Download | only in ltrace
      1 #
      2 # Copyright (C) 2014 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 
     17 LOCAL_PATH := $(call my-dir)
     18 
     19 # -------------------------------------------------------------------------
     20 
     21 include $(CLEAR_VARS)
     22 
     23 LOCAL_SRC_FILES := \
     24     bits.c \
     25     breakpoints.c \
     26     debug.c \
     27     demangle.c \
     28     dict.c \
     29     execute_program.c \
     30     expr.c \
     31     fetch.c \
     32     filter.c \
     33     glob.c \
     34     handle_event.c \
     35     lens.c \
     36     lens_default.c \
     37     lens_enum.c \
     38     libltrace.c \
     39     library.c \
     40     ltrace-elf.c \
     41     main.c \
     42     memstream.c \
     43     options.c \
     44     output.c \
     45     param.c \
     46     printf.c \
     47     proc.c \
     48     prototype.c \
     49     read_config_file.c \
     50     summary.c \
     51     type.c \
     52     value.c \
     53     value_dict.c \
     54     vect.c \
     55     zero.c \
     56     sysdeps/linux-gnu/breakpoint.c \
     57     sysdeps/linux-gnu/events.c \
     58     sysdeps/linux-gnu/hooks.c \
     59     sysdeps/linux-gnu/proc.c \
     60     sysdeps/linux-gnu/trace.c \
     61 
     62 LOCAL_C_INCLUDES := \
     63     $(LOCAL_PATH)/ \
     64     $(LOCAL_PATH)/sysdeps/ \
     65     $(LOCAL_PATH)/sysdeps/linux-gnu \
     66     external/elfutils \
     67     external/elfutils/0.153/libelf \
     68     external/libunwind/include \
     69 
     70 arm_path := sysdeps/linux-gnu/arm
     71 LOCAL_C_INCLUDES_arm := $(LOCAL_PATH)/$(arm_path)
     72 LOCAL_SRC_FILES_arm := \
     73     $(arm_path)/breakpoint.c \
     74     $(arm_path)/fetch.c \
     75     $(arm_path)/plt.c \
     76     $(arm_path)/regs.c \
     77     $(arm_path)/trace.c \
     78 
     79 arm64_path := sysdeps/linux-gnu/aarch64
     80 LOCAL_C_INCLUDES_arm64 := $(LOCAL_PATH)/$(arm64_path)
     81 LOCAL_SRC_FILES_arm64 := \
     82     $(arm64_path)/fetch.c \
     83     $(arm64_path)/plt.c \
     84     $(arm64_path)/regs.c \
     85     $(arm64_path)/trace.c \
     86 
     87 mips_path := sysdeps/linux-gnu/mips
     88 LOCAL_C_INCLUDES_mips := $(LOCAL_PATH)/$(mips_path)
     89 LOCAL_SRC_FILES_mips := \
     90     $(mips_path)/plt.c \
     91     $(mips_path)/regs.c \
     92     $(mips_path)/trace.c \
     93 
     94 x86_path := sysdeps/linux-gnu/x86
     95 LOCAL_C_INCLUDES_x86 := $(LOCAL_PATH)/$(x86_path)
     96 LOCAL_SRC_FILES_x86 := \
     97     $(x86_path)/fetch.c \
     98     $(x86_path)/plt.c \
     99     $(x86_path)/regs.c \
    100     $(x86_path)/trace.c \
    101 
    102 # x86_64 uses the same source as x86.
    103 LOCAL_C_INCLUDES_x86_64 := $(LOCAL_C_INCLUDES_x86)
    104 LOCAL_SRC_FILES_x86_64 := $(LOCAL_SRC_FILES_x86)
    105 
    106 LOCAL_CFLAGS := -D_GNU_SOURCE=1 -D_POSIX_SOURCE=1
    107 
    108 LOCAL_CFLAGS += \
    109     -DELF_HASH_TAKES_CHARP=1 \
    110     -DHAVE_ALARM=1 \
    111     -DHAVE_ATEXIT=1 \
    112     -DHAVE_DLFCN_H=1 \
    113     -DHAVE_ELF_C_READ_MMAP=1 \
    114     -DHAVE_ELF_H=1 \
    115     -DHAVE_FCNTL_H=1 \
    116     -DHAVE_FORK=1 \
    117     -DHAVE_GELF_H=1 \
    118     -DHAVE_GETOPT_LONG=1 \
    119     -DHAVE_GETTIMEOFDAY=1 \
    120     -DHAVE_INTTYPES_H=1 \
    121     -DHAVE_LIBELF=1 \
    122     -DHAVE_LIBSELINUX=1 \
    123     -DHAVE_LIBSTDC__=1 \
    124     -DHAVE_LIBUNWIND=1 \
    125     -DHAVE_LIBUNWIND_PTRACE=1 \
    126     -DHAVE_LIMITS_H=1 \
    127     -DHAVE_MEMORY_H=1 \
    128     -DHAVE_MEMSET=1 \
    129     -DHAVE_OPEN_MEMSTREAM=1 \
    130     -DHAVE_SELINUX_SELINUX_H=1 \
    131     -DHAVE_STDDEF_H=1 \
    132     -DHAVE_STDINT_H=1 \
    133     -DHAVE_STDLIB_H=1 \
    134     -DHAVE_STRCHR=1 \
    135     -DHAVE_STRDUP=1 \
    136     -DHAVE_STRERROR=1 \
    137     -DHAVE_STRINGS_H=1 \
    138     -DHAVE_STRING_H=1 \
    139     -DHAVE_STRSIGNAL=1 \
    140     -DHAVE_STRTOL=1 \
    141     -DHAVE_STRTOUL=1 \
    142     -DHAVE_SYS_IOCTL_H=1 \
    143     -DHAVE_SYS_PARAM_H=1 \
    144     -DHAVE_SYS_STAT_H=1 \
    145     -DHAVE_SYS_TIME_H=1 \
    146     -DHAVE_SYS_TYPES_H=1 \
    147     -DHAVE_UNISTD_H=1 \
    148     -DHAVE_UNWINDER=1 \
    149     -DHAVE_VFORK=1 \
    150     -DHAVE_WORKING_FORK=1 \
    151     -DHAVE_WORKING_VFORK=1 \
    152     -DLT_OBJDIR='".libs"' \
    153     -DPACKAGE='"ltrace"' \
    154     -DPACKAGE_BUGREPORT='"ltrace-devel (at] lists.alioth.debian.org"' \
    155     -DPACKAGE_NAME='"ltrace"' \
    156     -DPACKAGE_STRING='"ltrace 0.7.91"' \
    157     -DPACKAGE_TARNAME='"ltrace"' \
    158     -DPACKAGE_URL='"http://ltrace.alioth.debian.org/"' \
    159     -DPACKAGE_VERSION='"0.7.91"' \
    160     -DVERSION='"0.7.91"' \
    161     -D_FILE_OFFSET_BITS=64 \
    162     -D_LARGE_FILES=1 \
    163     -DPKGDATADIR=NULL \
    164     -DSYSCONFDIR='"/etc/"' \
    165     -Drindex=strrchr \
    166 
    167 LOCAL_CFLAGS_32 += -DSIZEOF_LONG=4
    168 LOCAL_CFLAGS_64 += -DSIZEOF_LONG=8
    169 
    170 LOCAL_CFLAGS += \
    171     -Wall \
    172     -Wno-missing-field-initializers \
    173     -Wno-unused-parameter \
    174     -Wno-sign-compare \
    175 
    176 LOCAL_STATIC_LIBRARIES := libelf
    177 
    178 LOCAL_SHARED_LIBRARIES := \
    179     libcutils \
    180     libgccdemangle \
    181     libselinux \
    182     libunwind \
    183     libunwind-ptrace \
    184 
    185 LOCAL_MODULE := ltrace
    186 
    187 LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
    188 
    189 LOCAL_MODULE_TAGS := debug
    190 
    191 LOCAL_MODULE_TARGET_ARCH := arm arm64 x86 x86_64
    192 
    193 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
    194 
    195 include $(BUILD_EXECUTABLE)
    196