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 17LOCAL_PATH := $(call my-dir) 18 19# ------------------------------------------------------------------------- 20 21include $(CLEAR_VARS) 22 23LOCAL_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 62LOCAL_C_INCLUDES := \ 63 $(LOCAL_PATH)/ \ 64 $(LOCAL_PATH)/sysdeps/ \ 65 $(LOCAL_PATH)/sysdeps/linux-gnu \ 66 67arm_path := sysdeps/linux-gnu/arm 68LOCAL_C_INCLUDES_arm := $(LOCAL_PATH)/$(arm_path) 69LOCAL_SRC_FILES_arm := \ 70 $(arm_path)/breakpoint.c \ 71 $(arm_path)/fetch.c \ 72 $(arm_path)/plt.c \ 73 $(arm_path)/regs.c \ 74 $(arm_path)/trace.c \ 75 76arm64_path := sysdeps/linux-gnu/aarch64 77LOCAL_C_INCLUDES_arm64 := $(LOCAL_PATH)/$(arm64_path) 78LOCAL_SRC_FILES_arm64 := \ 79 $(arm64_path)/fetch.c \ 80 $(arm64_path)/plt.c \ 81 $(arm64_path)/regs.c \ 82 $(arm64_path)/trace.c \ 83 84mips_path := sysdeps/linux-gnu/mips 85LOCAL_C_INCLUDES_mips := $(LOCAL_PATH)/$(mips_path) 86LOCAL_SRC_FILES_mips := \ 87 $(mips_path)/plt.c \ 88 $(mips_path)/regs.c \ 89 $(mips_path)/trace.c \ 90 91x86_path := sysdeps/linux-gnu/x86 92LOCAL_C_INCLUDES_x86 := $(LOCAL_PATH)/$(x86_path) 93LOCAL_SRC_FILES_x86 := \ 94 $(x86_path)/fetch.c \ 95 $(x86_path)/plt.c \ 96 $(x86_path)/regs.c \ 97 $(x86_path)/trace.c \ 98 99# x86_64 uses the same source as x86. 100LOCAL_C_INCLUDES_x86_64 := $(LOCAL_C_INCLUDES_x86) 101LOCAL_SRC_FILES_x86_64 := $(LOCAL_SRC_FILES_x86) 102 103LOCAL_CFLAGS += \ 104 -DELF_HASH_TAKES_CHARP=1 \ 105 -DHAVE_ALARM=1 \ 106 -DHAVE_ATEXIT=1 \ 107 -DHAVE_DLFCN_H=1 \ 108 -DHAVE_ELF_C_READ_MMAP=1 \ 109 -DHAVE_ELF_H=1 \ 110 -DHAVE_FCNTL_H=1 \ 111 -DHAVE_FORK=1 \ 112 -DHAVE_GELF_H=1 \ 113 -DHAVE_GETOPT_LONG=1 \ 114 -DHAVE_GETTIMEOFDAY=1 \ 115 -DHAVE_INTTYPES_H=1 \ 116 -DHAVE_LIBELF=1 \ 117 -DHAVE_LIBSELINUX=1 \ 118 -DHAVE_LIBSTDC__=1 \ 119 -DHAVE_LIBUNWIND=1 \ 120 -DHAVE_LIBUNWIND_PTRACE=1 \ 121 -DHAVE_LIMITS_H=1 \ 122 -DHAVE_MEMORY_H=1 \ 123 -DHAVE_MEMSET=1 \ 124 -DHAVE_OPEN_MEMSTREAM=1 \ 125 -DHAVE_SELINUX_SELINUX_H=1 \ 126 -DHAVE_STDDEF_H=1 \ 127 -DHAVE_STDINT_H=1 \ 128 -DHAVE_STDLIB_H=1 \ 129 -DHAVE_STRCHR=1 \ 130 -DHAVE_STRDUP=1 \ 131 -DHAVE_STRERROR=1 \ 132 -DHAVE_STRINGS_H=1 \ 133 -DHAVE_STRING_H=1 \ 134 -DHAVE_STRSIGNAL=1 \ 135 -DHAVE_STRTOL=1 \ 136 -DHAVE_STRTOUL=1 \ 137 -DHAVE_SYS_IOCTL_H=1 \ 138 -DHAVE_SYS_PARAM_H=1 \ 139 -DHAVE_SYS_STAT_H=1 \ 140 -DHAVE_SYS_TIME_H=1 \ 141 -DHAVE_SYS_TYPES_H=1 \ 142 -DHAVE_UNISTD_H=1 \ 143 -DHAVE_UNWINDER=1 \ 144 -DHAVE_VFORK=1 \ 145 -DHAVE_WORKING_FORK=1 \ 146 -DHAVE_WORKING_VFORK=1 \ 147 -DLT_OBJDIR='".libs"' \ 148 -DPACKAGE='"ltrace"' \ 149 -DPACKAGE_BUGREPORT='"ltrace-devel@lists.alioth.debian.org"' \ 150 -DPACKAGE_NAME='"ltrace"' \ 151 -DPACKAGE_STRING='"ltrace 0.7.91"' \ 152 -DPACKAGE_TARNAME='"ltrace"' \ 153 -DPACKAGE_URL='"http://ltrace.alioth.debian.org/"' \ 154 -DPACKAGE_VERSION='"0.7.91"' \ 155 -DVERSION='"0.7.91"' \ 156 -D_FILE_OFFSET_BITS=64 \ 157 -D_LARGE_FILES=1 \ 158 -DPKGDATADIR=NULL \ 159 -DSYSCONFDIR='"/etc/"' \ 160 -Drindex=strrchr \ 161 162LOCAL_CFLAGS_32 += -DSIZEOF_LONG=4 163LOCAL_CFLAGS_64 += -DSIZEOF_LONG=8 164 165LOCAL_CFLAGS += \ 166 -Wall \ 167 -Wno-missing-field-initializers \ 168 -Wno-unused-parameter \ 169 -Wno-sign-compare \ 170 171LOCAL_STATIC_LIBRARIES := libelf 172 173LOCAL_SHARED_LIBRARIES := \ 174 libcutils \ 175 libselinux \ 176 libunwind \ 177 178LOCAL_MODULE := ltrace 179 180LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES) 181 182LOCAL_MODULE_TAGS := debug 183 184LOCAL_MODULE_TARGET_ARCH := arm arm64 x86 x86_64 185 186LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk 187 188include $(BUILD_EXECUTABLE) 189