1# Copyright 2006 The Android Open Source Project 2 3LOCAL_PATH := $(my-dir) 4include $(CLEAR_VARS) 5 6# From autoconf-generated Makefile 7strace_SOURCES = strace.c syscall.c count.c util.c desc.c file.c ipc.c \ 8 io.c ioctl.c mem.c net.c process.c bjm.c quota.c \ 9 resource.c signal.c sock.c system.c term.c time.c \ 10 proc.c stream.c block.c 11 12#excluded_sources = scsi.c 13 14strace_VERSION = 4.6 15 16LOCAL_SRC_FILES:= $(strace_SOURCES) 17 18LOCAL_SHARED_LIBRARIES := 19 20LOCAL_CFLAGS := -DLINUX=1 \ 21 -DGETGROUPS_T=gid_t \ 22 -DHAVE_ASM_SIGCONTEXT_H=1 \ 23 -DHAVE_DECL_SYS_ERRLIST=1 \ 24 -DHAVE_DECL_SYS_SIGLIST=1 \ 25 -DHAVE_DECL_____PTRACE_EVENT_CLONE=1 \ 26 -DHAVE_DECL_____PTRACE_EVENT_FORK=1 \ 27 -DHAVE_DECL_____PTRACE_EVENT_VFORK=1 \ 28 -DHAVE_DECL_____PTRACE_GETEVENTMSG=1 \ 29 -DHAVE_DECL_____PTRACE_GETSIGINFO=1 \ 30 -DHAVE_DECL_____PTRACE_O_TRACECLONE=1 \ 31 -DHAVE_DECL_____PTRACE_O_TRACEFORK=1 \ 32 -DHAVE_DECL_____PTRACE_O_TRACEVFORK=1 \ 33 -DHAVE_DECL_____PTRACE_SETOPTIONS=1 \ 34 -DHAVE_DECL_____PTRACE_EVENT_CLONE=1 \ 35 -DHAVE_DECL_____PTRACE_EVENT_CLONE=1 \ 36 -DHAVE_DIRENT_H=1 \ 37 -DHAVE_FORK=1 \ 38 -DHAVE_GETDENTS=1 \ 39 -DHAVE_IF_INDEXTONAME=1 \ 40 -DHAVE_INET_NTOP=1 \ 41 -DHAVE_INTTYPES_H=1 \ 42 -DHAVE_LINUX_CAPABILITY_H=1 \ 43 -DHAVE_LINUX_ICMP_H=1 \ 44 -DHAVE_LINUX_IF_PACKET_H=1 \ 45 -DHAVE_LINUX_IN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 87 -DPACKAGE=strace \ 88 -DPACKAGE_BUGREPORT= \ 89 -DPACKAGE_NAME='"strace"' \ 90 -DPACKAGE_STRING='"strace $(strace_VERSION)"' \ 91 -DPACKAGE_TARNAME='"strace"' \ 92 -DPACKAGE_VERSION='"$(strace_VERSION)"' \ 93 -DRETSIGTYPE=void \ 94 -DSTDC_HEADER=1 \ 95 -DVERSION='"$(strace_VERSION)"' \ 96 -D_GNU_SOURCE=1 \ 97 -D_POSIX_SOURCE=1 \ 98 -Dfopen64=fopen \ 99 -Dd_fileno=d_ino \ 100 -D_LFS64_LARGEFILE=1 \ 101 -D__KERNEL__=1 102 103#These are defined in AndroidConfig.h so we omit them above. 104# -DHAVE_SYS_UIO_H=1 \ 105# -DHAVE_TERMIO_H=1 \ 106 107 108arch := $(TARGET_ARCH) 109ifeq ($(TARGET_ARCH),arm) 110 LOCAL_CFLAGS += -DARM=1 -DHAVE_LITTLE_ENDIAN_LONG_LONG=1 111 LOCAL_CFLAGS += -DHAVE_STRUCT___OLD_KERNEL_STAT=1 112else ifeq ($(TARGET_ARCH),x86) 113 LOCAL_CFLAGS += -DI386=1 -DHAVE_LITTLE_ENDIAN_LONG_LONG=1 114 LOCAL_CFLAGS += -DHAVE_STRUCT___OLD_KERNEL_STAT=1 115 arch := i386 116else ifeq ($(TARGET_ARCH),sh) 117 LOCAL_CFLAGS += -DSH=1 -DHAVE_LITTLE_ENDIAN_LONG_LONG=1 118 LOCAL_CFLAGS += -DHAVE_STRUCT___OLD_KERNEL_STAT=1 119else ifeq ($(TARGET_ARCH),mips) 120 LOCAL_CFLAGS += -DMIPS=1 -DHAVE_LITTLE_ENDIAN_LONG_LONG=1 121# Mips does not use STRUCT__OLD_KERNEL_STAT type 122endif 123 124LOCAL_CFLAGS += -Wno-missing-field-initializers 125 126LOCAL_C_INCLUDES := \ 127 $(KERNEL_HEADERS) \ 128 $(LOCAL_PATH)/linux \ 129 $(LOCAL_PATH)/linux/$(arch) 130 131LOCAL_MODULE := strace 132 133LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES) 134 135LOCAL_MODULE_TAGS := debug 136 137include $(BUILD_EXECUTABLE) 138