Elliott Hughes | 858a5c7 | 2014-02-28 15:58:12 -0800 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2006 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 | # |
The Android Open Source Project | 34d6eab | 2009-03-03 19:30:45 -0800 | [diff] [blame] | 16 | |
Elliott Hughes | 858a5c7 | 2014-02-28 15:58:12 -0800 | [diff] [blame] | 17 | LOCAL_PATH := $(call my-dir) |
Elliott Hughes | 7c53832 | 2014-02-28 10:32:04 -0800 | [diff] [blame] | 18 | |
Elliott Hughes | 4e779b4 | 2014-05-07 09:10:38 -0700 | [diff] [blame] | 19 | # |
| 20 | # To update: |
| 21 | # |
| 22 | |
Elliott Hughes | 60b6d90 | 2014-06-06 22:42:41 -0700 | [diff] [blame] | 23 | # git remote add strace git://git.code.sf.net/p/strace/code |
Elliott Hughes | 4e779b4 | 2014-05-07 09:10:38 -0700 | [diff] [blame] | 24 | # git fetch strace |
| 25 | # git merge strace/master |
| 26 | # mm -j32 |
| 27 | # # (Make any necessary Android.mk changes and test the new strace.) |
Elliott Hughes | 60b6d90 | 2014-06-06 22:42:41 -0700 | [diff] [blame] | 28 | # git push aosp HEAD:master # Push directly, avoiding gerrit. |
| 29 | # git push aosp HEAD:refs/for/master # Push to gerrit. |
Elliott Hughes | 4e779b4 | 2014-05-07 09:10:38 -0700 | [diff] [blame] | 30 | # |
| 31 | # # Now commit any necessary Android.mk changes like normal: |
| 32 | # repo start post-sync . |
| 33 | # git commit -a |
| 34 | # |
| 35 | |
Elliott Hughes | 9e25f2c | 2014-10-03 11:01:13 -0700 | [diff] [blame] | 36 | # We don't currently have a good solution for the 'configure' side of things. |
| 37 | # You can get a list of the HAVE_* variables in use and manually go through it: |
| 38 | # |
| 39 | # find . -name "*.[ch]" | xargs grep HAVE_ | sed 's/.*\(HAVE_[A-Z0-9_]*\).*/\1/p' | sort | uniq -d |
| 40 | |
Elliott Hughes | 7c53832 | 2014-02-28 10:32:04 -0800 | [diff] [blame] | 41 | # ------------------------------------------------------------------------- |
| 42 | |
The Android Open Source Project | 34d6eab | 2009-03-03 19:30:45 -0800 | [diff] [blame] | 43 | include $(CLEAR_VARS) |
| 44 | |
Elliott Hughes | 15fc6a2 | 2014-01-09 10:30:06 -0800 | [diff] [blame] | 45 | strace_version := $(shell grep Version $(LOCAL_PATH)/strace.spec | cut -d " " -f 2) |
The Android Open Source Project | 34d6eab | 2009-03-03 19:30:45 -0800 | [diff] [blame] | 46 | |
Elliott Hughes | bb0c2d5 | 2014-01-07 17:34:14 -0800 | [diff] [blame] | 47 | LOCAL_SRC_FILES := \ |
Elliott Hughes | caca6ee | 2015-01-06 12:18:17 -0800 | [diff] [blame] | 48 | access.c \ |
| 49 | affinity.c \ |
Elliott Hughes | 5dec78d | 2014-02-26 15:56:23 -0800 | [diff] [blame] | 50 | aio.c \ |
Elliott Hughes | bb0c2d5 | 2014-01-07 17:34:14 -0800 | [diff] [blame] | 51 | bjm.c \ |
| 52 | block.c \ |
Elliott Hughes | caca6ee | 2015-01-06 12:18:17 -0800 | [diff] [blame] | 53 | cacheflush.c \ |
| 54 | capability.c \ |
| 55 | chdir.c \ |
| 56 | chmod.c \ |
| 57 | clone.c \ |
Elliott Hughes | bb0c2d5 | 2014-01-07 17:34:14 -0800 | [diff] [blame] | 58 | count.c \ |
| 59 | desc.c \ |
Elliott Hughes | 1f72dc7 | 2014-09-22 10:04:17 -0700 | [diff] [blame] | 60 | dirent.c \ |
Elliott Hughes | caca6ee | 2015-01-06 12:18:17 -0800 | [diff] [blame] | 61 | execve.c \ |
| 62 | exit.c \ |
| 63 | fadvise.c \ |
| 64 | fallocate.c \ |
Elliott Hughes | 5dec78d | 2014-02-26 15:56:23 -0800 | [diff] [blame] | 65 | fanotify.c \ |
Elliott Hughes | caca6ee | 2015-01-06 12:18:17 -0800 | [diff] [blame] | 66 | fchownat.c \ |
Elliott Hughes | bb0c2d5 | 2014-01-07 17:34:14 -0800 | [diff] [blame] | 67 | file.c \ |
Elliott Hughes | caca6ee | 2015-01-06 12:18:17 -0800 | [diff] [blame] | 68 | futex.c \ |
| 69 | getcpu.c \ |
| 70 | getcwd.c \ |
Elliott Hughes | 0328d0a | 2015-03-18 11:18:43 -0700 | [diff] [blame] | 71 | getrandom.c \ |
Elliott Hughes | caca6ee | 2015-01-06 12:18:17 -0800 | [diff] [blame] | 72 | get_robust_list.c \ |
| 73 | hostname.c \ |
Elliott Hughes | 5dec78d | 2014-02-26 15:56:23 -0800 | [diff] [blame] | 74 | inotify.c \ |
Elliott Hughes | bb0c2d5 | 2014-01-07 17:34:14 -0800 | [diff] [blame] | 75 | io.c \ |
| 76 | ioctl.c \ |
Elliott Hughes | 5dec78d | 2014-02-26 15:56:23 -0800 | [diff] [blame] | 77 | ioprio.c \ |
Elliott Hughes | bb0c2d5 | 2014-01-07 17:34:14 -0800 | [diff] [blame] | 78 | ipc.c \ |
Elliott Hughes | 5dec78d | 2014-02-26 15:56:23 -0800 | [diff] [blame] | 79 | kexec.c \ |
| 80 | keyctl.c \ |
Elliott Hughes | 5150567 | 2014-04-10 11:06:16 -0700 | [diff] [blame] | 81 | ldt.c \ |
Elliott Hughes | caca6ee | 2015-01-06 12:18:17 -0800 | [diff] [blame] | 82 | link.c \ |
Elliott Hughes | bb0c2d5 | 2014-01-07 17:34:14 -0800 | [diff] [blame] | 83 | loop.c \ |
Elliott Hughes | caca6ee | 2015-01-06 12:18:17 -0800 | [diff] [blame] | 84 | lseek.c \ |
Elliott Hughes | bb0c2d5 | 2014-01-07 17:34:14 -0800 | [diff] [blame] | 85 | mem.c \ |
Elliott Hughes | caca6ee | 2015-01-06 12:18:17 -0800 | [diff] [blame] | 86 | mknod.c \ |
| 87 | mount.c \ |
Elliott Hughes | bb0c2d5 | 2014-01-07 17:34:14 -0800 | [diff] [blame] | 88 | mtd.c \ |
| 89 | net.c \ |
Elliott Hughes | caca6ee | 2015-01-06 12:18:17 -0800 | [diff] [blame] | 90 | open.c \ |
Elliott Hughes | bb0c2d5 | 2014-01-07 17:34:14 -0800 | [diff] [blame] | 91 | pathtrace.c \ |
Elliott Hughes | caca6ee | 2015-01-06 12:18:17 -0800 | [diff] [blame] | 92 | personality.c \ |
| 93 | prctl.c \ |
| 94 | printmode.c \ |
Elliott Hughes | bb0c2d5 | 2014-01-07 17:34:14 -0800 | [diff] [blame] | 95 | process.c \ |
Elliott Hughes | caca6ee | 2015-01-06 12:18:17 -0800 | [diff] [blame] | 96 | process_vm.c \ |
Elliott Hughes | 5dec78d | 2014-02-26 15:56:23 -0800 | [diff] [blame] | 97 | ptp.c \ |
Elliott Hughes | bb0c2d5 | 2014-01-07 17:34:14 -0800 | [diff] [blame] | 98 | quota.c \ |
Elliott Hughes | caca6ee | 2015-01-06 12:18:17 -0800 | [diff] [blame] | 99 | readahead.c \ |
| 100 | readlink.c \ |
Elliott Hughes | 5dec78d | 2014-02-26 15:56:23 -0800 | [diff] [blame] | 101 | reboot.c \ |
Elliott Hughes | caca6ee | 2015-01-06 12:18:17 -0800 | [diff] [blame] | 102 | renameat.c \ |
Elliott Hughes | bb0c2d5 | 2014-01-07 17:34:14 -0800 | [diff] [blame] | 103 | resource.c \ |
Elliott Hughes | caca6ee | 2015-01-06 12:18:17 -0800 | [diff] [blame] | 104 | sched.c \ |
Elliott Hughes | 5dec78d | 2014-02-26 15:56:23 -0800 | [diff] [blame] | 105 | scsi.c \ |
Elliott Hughes | 0328d0a | 2015-03-18 11:18:43 -0700 | [diff] [blame] | 106 | seccomp.c \ |
Elliott Hughes | bb0c2d5 | 2014-01-07 17:34:14 -0800 | [diff] [blame] | 107 | signal.c \ |
Elliott Hughes | 0328d0a | 2015-03-18 11:18:43 -0700 | [diff] [blame] | 108 | sigreturn.c \ |
Elliott Hughes | bb0c2d5 | 2014-01-07 17:34:14 -0800 | [diff] [blame] | 109 | sock.c \ |
Elliott Hughes | 1f72dc7 | 2014-09-22 10:04:17 -0700 | [diff] [blame] | 110 | socketutils.c \ |
Elliott Hughes | caca6ee | 2015-01-06 12:18:17 -0800 | [diff] [blame] | 111 | sram_alloc.c \ |
Elliott Hughes | 1f72dc7 | 2014-09-22 10:04:17 -0700 | [diff] [blame] | 112 | statfs.c \ |
Elliott Hughes | bb0c2d5 | 2014-01-07 17:34:14 -0800 | [diff] [blame] | 113 | strace.c \ |
| 114 | stream.c \ |
Elliott Hughes | caca6ee | 2015-01-06 12:18:17 -0800 | [diff] [blame] | 115 | swapon.c \ |
| 116 | sync_file_range.c \ |
Elliott Hughes | bb0c2d5 | 2014-01-07 17:34:14 -0800 | [diff] [blame] | 117 | syscall.c \ |
Elliott Hughes | caca6ee | 2015-01-06 12:18:17 -0800 | [diff] [blame] | 118 | sysctl.c \ |
Elliott Hughes | 5a9d3b9 | 2014-10-03 09:50:14 -0700 | [diff] [blame] | 119 | sysinfo.c \ |
Elliott Hughes | caca6ee | 2015-01-06 12:18:17 -0800 | [diff] [blame] | 120 | syslog.c \ |
| 121 | sysmips.c \ |
Elliott Hughes | bb0c2d5 | 2014-01-07 17:34:14 -0800 | [diff] [blame] | 122 | term.c \ |
| 123 | time.c \ |
Elliott Hughes | caca6ee | 2015-01-06 12:18:17 -0800 | [diff] [blame] | 124 | truncate.c \ |
| 125 | uid16.c \ |
| 126 | uid.c \ |
| 127 | umask.c \ |
| 128 | umount.c \ |
| 129 | uname.c \ |
Elliott Hughes | bb0c2d5 | 2014-01-07 17:34:14 -0800 | [diff] [blame] | 130 | util.c \ |
Elliott Hughes | caca6ee | 2015-01-06 12:18:17 -0800 | [diff] [blame] | 131 | utime.c \ |
| 132 | utimes.c \ |
| 133 | v4l2.c \ |
Elliott Hughes | 5dec78d | 2014-02-26 15:56:23 -0800 | [diff] [blame] | 134 | vsprintf.c \ |
Elliott Hughes | caca6ee | 2015-01-06 12:18:17 -0800 | [diff] [blame] | 135 | wait.c \ |
| 136 | xattr.c \ |
The Android Open Source Project | 34d6eab | 2009-03-03 19:30:45 -0800 | [diff] [blame] | 137 | |
| 138 | LOCAL_SHARED_LIBRARIES := |
| 139 | |
Elliott Hughes | 15fc6a2 | 2014-01-09 10:30:06 -0800 | [diff] [blame] | 140 | LOCAL_CFLAGS := \ |
| 141 | -DGETGROUPS_T=gid_t \ |
| 142 | -DHAVE_ASM_SIGCONTEXT_H=1 \ |
| 143 | -DHAVE_DECL_PTRACE_EVENT_FORK=1 \ |
| 144 | -DHAVE_DECL_PTRACE_EVENT_VFORK=1 \ |
| 145 | -DHAVE_DECL_PTRACE_EVENT_CLONE=1 \ |
| 146 | -DHAVE_DECL_PTRACE_EVENT_EXEC=1 \ |
| 147 | -DHAVE_DECL_PTRACE_EVENT_VFORK_DONE=1 \ |
| 148 | -DHAVE_DECL_PTRACE_EVENT_EXIT=1 \ |
| 149 | -DHAVE_DECL_PTRACE_GETEVENTMSG=1 \ |
| 150 | -DHAVE_DECL_PTRACE_GETSIGINFO=1 \ |
| 151 | -DHAVE_DECL_PTRACE_O_TRACECLONE=1 \ |
| 152 | -DHAVE_DECL_PTRACE_O_TRACEEXEC=1 \ |
| 153 | -DHAVE_DECL_PTRACE_O_TRACEEXIT=1 \ |
| 154 | -DHAVE_DECL_PTRACE_O_TRACEFORK=1 \ |
| 155 | -DHAVE_DECL_PTRACE_O_TRACESYSGOOD=1 \ |
| 156 | -DHAVE_DECL_PTRACE_O_TRACEVFORK=1 \ |
| 157 | -DHAVE_DECL_PTRACE_SETOPTIONS=1 \ |
| 158 | -UHAVE_DECL_IO_CMD_PWRITE \ |
| 159 | -UHAVE_DECL_IO_CMD_PWRITEV \ |
| 160 | -UHAVE_DECL_LO_FLAGS_AUTOCLEAR \ |
| 161 | -UHAVE_DECL_LO_FLAGS_PARTSCAN \ |
| 162 | -DHAVE_DECL_SYS_ERRLIST=1 \ |
Elliott Hughes | a7f5555 | 2014-01-09 16:07:59 -0800 | [diff] [blame] | 163 | -DHAVE_ELF_H=1 \ |
Elliott Hughes | 9e25f2c | 2014-10-03 11:01:13 -0700 | [diff] [blame] | 164 | -DHAVE_FOPEN64=1 \ |
Elliott Hughes | 15fc6a2 | 2014-01-09 10:30:06 -0800 | [diff] [blame] | 165 | -DHAVE_FORK=1 \ |
| 166 | -DHAVE_IF_INDEXTONAME=1 \ |
| 167 | -DHAVE_INET_NTOP=1 \ |
| 168 | -DHAVE_LINUX_CAPABILITY_H=1 \ |
Elliott Hughes | caca6ee | 2015-01-06 12:18:17 -0800 | [diff] [blame] | 169 | -DHAVE_LINUX_FALLOC_H=1 \ |
Elliott Hughes | 0328d0a | 2015-03-18 11:18:43 -0700 | [diff] [blame] | 170 | -DHAVE_LINUX_FILTER_H=1 \ |
Elliott Hughes | 9e25f2c | 2014-10-03 11:01:13 -0700 | [diff] [blame] | 171 | -DHAVE_LINUX_FUTEX_H=1 \ |
Elliott Hughes | 15fc6a2 | 2014-01-09 10:30:06 -0800 | [diff] [blame] | 172 | -DHAVE_LINUX_ICMP_H=1 \ |
| 173 | -DHAVE_LINUX_IF_PACKET_H=1 \ |
| 174 | -DHAVE_LINUX_IN6_H=1 \ |
| 175 | -DHAVE_LINUX_NETLINK_H=1 \ |
Elliott Hughes | 9e25f2c | 2014-10-03 11:01:13 -0700 | [diff] [blame] | 176 | -DHAVE_LINUX_PERF_EVENT_H=1 \ |
Elliott Hughes | 15fc6a2 | 2014-01-09 10:30:06 -0800 | [diff] [blame] | 177 | -DHAVE_LITTLE_ENDIAN_LONG_LONG=1 \ |
| 178 | -DHAVE_LONG_LONG=1 \ |
| 179 | -DHAVE_NETINET_TCP_H=1 \ |
| 180 | -DHAVE_NETINET_UDP_H=1 \ |
| 181 | -DHAVE_POLL_H=1 \ |
| 182 | -DHAVE_PRCTL=1 \ |
Elliott Hughes | 9e25f2c | 2014-10-03 11:01:13 -0700 | [diff] [blame] | 183 | -DHAVE_PWRITEV=1 \ |
Elliott Hughes | 15fc6a2 | 2014-01-09 10:30:06 -0800 | [diff] [blame] | 184 | -DHAVE_SENDMSG=1 \ |
| 185 | -DHAVE_SIGACTION=1 \ |
Elliott Hughes | 15fc6a2 | 2014-01-09 10:30:06 -0800 | [diff] [blame] | 186 | -DHAVE_SIG_ATOMIC_T=1 \ |
Elliott Hughes | 9e25f2c | 2014-10-03 11:01:13 -0700 | [diff] [blame] | 187 | -DHAVE_SIGINFO_T=1 \ |
Elliott Hughes | 0328d0a | 2015-03-18 11:18:43 -0700 | [diff] [blame] | 188 | -DHAVE_SIGINFO_T_SI_OVERRUN=1 \ |
Elliott Hughes | 9e25f2c | 2014-10-03 11:01:13 -0700 | [diff] [blame] | 189 | -DHAVE_SIGINFO_T_SI_SYSCALL=1 \ |
Elliott Hughes | 0328d0a | 2015-03-18 11:18:43 -0700 | [diff] [blame] | 190 | -DHAVE_SIGINFO_T_SI_TIMERID=1 \ |
Elliott Hughes | ad8fa13 | 2014-10-03 11:56:40 -0700 | [diff] [blame] | 191 | -UHAVE_STAT64 \ |
Elliott Hughes | 15fc6a2 | 2014-01-09 10:30:06 -0800 | [diff] [blame] | 192 | -DHAVE_STATFS64=1 \ |
| 193 | -DHAVE_STDBOOL_H=1 \ |
| 194 | -DHAVE_STRERROR=1 \ |
Elliott Hughes | 5dec78d | 2014-02-26 15:56:23 -0800 | [diff] [blame] | 195 | -DHAVE_STRUCT_FLOCK64=1 \ |
Elliott Hughes | caca6ee | 2015-01-06 12:18:17 -0800 | [diff] [blame] | 196 | -DHAVE_STRUCT_MMSGHDR=1 \ |
Elliott Hughes | 15fc6a2 | 2014-01-09 10:30:06 -0800 | [diff] [blame] | 197 | -DHAVE_STRUCT_MSGHDR_MSG_CONTROL=1 \ |
Elliott Hughes | 4e779b4 | 2014-05-07 09:10:38 -0700 | [diff] [blame] | 198 | -DHAVE_STRUCT_SIGCONTEXT=1 \ |
| 199 | -DHAVE_STRUCT_SIGEVENT__SIGEV_UN__PAD=1 \ |
Elliott Hughes | 15fc6a2 | 2014-01-09 10:30:06 -0800 | [diff] [blame] | 200 | -DHAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID=1 \ |
Elliott Hughes | 0328d0a | 2015-03-18 11:18:43 -0700 | [diff] [blame] | 201 | -DHAVE_STRUCT_STATFS64=1 \ |
Elliott Hughes | 9e25f2c | 2014-10-03 11:01:13 -0700 | [diff] [blame] | 202 | -DHAVE_STRUCT_STAT_ST_ACLCNT=0 \ |
Elliott Hughes | 15fc6a2 | 2014-01-09 10:30:06 -0800 | [diff] [blame] | 203 | -DHAVE_STRUCT_STAT_ST_BLKSIZE=1 \ |
| 204 | -DHAVE_STRUCT_STAT_ST_BLOCKS=1 \ |
Elliott Hughes | 9e25f2c | 2014-10-03 11:01:13 -0700 | [diff] [blame] | 205 | -DHAVE_STRUCT_STAT_ST_FLAGS=0 \ |
| 206 | -DHAVE_STRUCT_STAT_ST_FSTYPE=0 \ |
| 207 | -DHAVE_STRUCT_STAT_ST_GEN=0 \ |
| 208 | -DHAVE_STRUCT_STAT_ST_LEVEL=0 \ |
Elliott Hughes | 15fc6a2 | 2014-01-09 10:30:06 -0800 | [diff] [blame] | 209 | -DHAVE_STRUCT_STAT_ST_RDEV=1 \ |
Elliott Hughes | 37be67d | 2014-10-03 09:58:58 -0700 | [diff] [blame] | 210 | -DHAVE_STRUCT_SYSINFO_FREEHIGH=1 \ |
| 211 | -DHAVE_STRUCT_SYSINFO_MEM_UNIT=1 \ |
| 212 | -DHAVE_STRUCT_SYSINFO_TOTALHIGH=1 \ |
Elliott Hughes | 9e25f2c | 2014-10-03 11:01:13 -0700 | [diff] [blame] | 213 | -DHAVE_STRUCT_UTSNAME_DOMAINNAME=1 \ |
Elliott Hughes | 15fc6a2 | 2014-01-09 10:30:06 -0800 | [diff] [blame] | 214 | -DHAVE_SYS_EPOLL_H=1 \ |
| 215 | -DHAVE_SYS_IOCTL_H=1 \ |
| 216 | -DHAVE_SYS_POLL_H=1 \ |
| 217 | -DHAVE_SYS_REG_H=1 \ |
| 218 | -DHAVE_SYS_VFS_H=1 \ |
Elliott Hughes | 0328d0a | 2015-03-18 11:18:43 -0700 | [diff] [blame] | 219 | -DHAVE_SYS_XATTR_H=1 \ |
Elliott Hughes | 15fc6a2 | 2014-01-09 10:30:06 -0800 | [diff] [blame] | 220 | -DMAJOR_IN_SYSMACROS \ |
| 221 | -DPACKAGE_NAME='"strace"' \ |
| 222 | -DVERSION='"$(strace_version)"' \ |
Elliott Hughes | 556f9ae | 2014-03-03 16:08:32 -0800 | [diff] [blame] | 223 | -DSIZEOF_OFF_T=SIZEOF_LONG \ |
Elliott Hughes | 15fc6a2 | 2014-01-09 10:30:06 -0800 | [diff] [blame] | 224 | -DSIZEOF_LONG_LONG=8 \ |
| 225 | -DSTDC_HEADERS=1 \ |
Elliott Hughes | 5dec78d | 2014-02-26 15:56:23 -0800 | [diff] [blame] | 226 | -DSTRACE_KNOWS_ONLY_EABI=1 \ |
Elliott Hughes | 15fc6a2 | 2014-01-09 10:30:06 -0800 | [diff] [blame] | 227 | -D_LFS64_LARGEFILE=1 \ |
| 228 | |
| 229 | LOCAL_CFLAGS += -D_GNU_SOURCE=1 -D_POSIX_SOURCE=1 |
Elliott Hughes | bb0c2d5 | 2014-01-07 17:34:14 -0800 | [diff] [blame] | 230 | |
Elliott Hughes | 4ce18c8 | 2014-04-09 19:23:30 -0700 | [diff] [blame] | 231 | LOCAL_CFLAGS_32 += -DSIZEOF_LONG=4 -DSIZEOF_RLIM_T=4 -DHAVE_STAT64=1 |
Colin Cross | d6b039c | 2014-01-29 18:09:48 -0800 | [diff] [blame] | 232 | LOCAL_CFLAGS_64 += -DSIZEOF_LONG=8 -DSIZEOF_RLIM_T=8 |
Jeff Brown | f76f96e | 2012-03-02 16:23:23 -0800 | [diff] [blame] | 233 | |
Colin Cross | d6b039c | 2014-01-29 18:09:48 -0800 | [diff] [blame] | 234 | LOCAL_CFLAGS_arm += -DARM=1 |
| 235 | LOCAL_CFLAGS_arm += -DHAVE_STRUCT___OLD_KERNEL_STAT=1 |
| 236 | |
| 237 | LOCAL_CFLAGS_arm64 += -DAARCH64=1 |
| 238 | |
| 239 | LOCAL_CFLAGS_mips += -DMIPS=1 |
| 240 | LOCAL_CFLAGS_mips += -DHAVE_ASM_SYSMIPS_H=1 |
| 241 | |
Raghu Gandham | 5577601 | 2014-08-29 12:20:30 -0700 | [diff] [blame] | 242 | LOCAL_CFLAGS_mips64 += -DMIPS=1 |
| 243 | LOCAL_CFLAGS_mips64 += -DHAVE_ASM_SYSMIPS_H=1 |
| 244 | |
Colin Cross | d6b039c | 2014-01-29 18:09:48 -0800 | [diff] [blame] | 245 | LOCAL_CFLAGS_x86 += -DI386=1 |
| 246 | LOCAL_CFLAGS_x86 += -DHAVE_STRUCT___OLD_KERNEL_STAT=1 |
| 247 | |
Elliott Hughes | 4ce18c8 | 2014-04-09 19:23:30 -0700 | [diff] [blame] | 248 | LOCAL_CFLAGS_x86_64 += -DX86_64=1 |
Lorenzo Colitti | a0b125c | 2009-08-20 15:06:43 -0700 | [diff] [blame] | 249 | |
Elliott Hughes | bb0c2d5 | 2014-01-07 17:34:14 -0800 | [diff] [blame] | 250 | LOCAL_CFLAGS += \ |
Elliott Hughes | 10bd42d | 2014-01-08 16:34:09 -0800 | [diff] [blame] | 251 | -Wall \ |
Elliott Hughes | 1f72dc7 | 2014-09-22 10:04:17 -0700 | [diff] [blame] | 252 | -Wwrite-strings \ |
| 253 | -Wsign-compare \ |
Elliott Hughes | bb0c2d5 | 2014-01-07 17:34:14 -0800 | [diff] [blame] | 254 | -Wno-missing-field-initializers \ |
| 255 | -Wno-unused-parameter \ |
| 256 | -Wno-sign-compare \ |
Jeff Brown | f76f96e | 2012-03-02 16:23:23 -0800 | [diff] [blame] | 257 | |
Elliott Hughes | 0328d0a | 2015-03-18 11:18:43 -0700 | [diff] [blame] | 258 | LOCAL_C_INCLUDES_arm := $(LOCAL_PATH)/linux/arm $(LOCAL_PATH)/linux |
| 259 | LOCAL_C_INCLUDES_arm64 := $(LOCAL_PATH)/linux/aarch64 $(LOCAL_PATH)/linux |
| 260 | LOCAL_C_INCLUDES_mips := $(LOCAL_PATH)/linux/mips $(LOCAL_PATH)/linux |
| 261 | LOCAL_C_INCLUDES_mips64 := $(LOCAL_PATH)/linux/mips $(LOCAL_PATH)/linux |
| 262 | LOCAL_C_INCLUDES_x86 := $(LOCAL_PATH)/linux/i386 $(LOCAL_PATH)/linux |
| 263 | LOCAL_C_INCLUDES_x86_64 := $(LOCAL_PATH)/linux/x86_64 $(LOCAL_PATH)/linux |
Colin Cross | d6b039c | 2014-01-29 18:09:48 -0800 | [diff] [blame] | 264 | |
The Android Open Source Project | 34d6eab | 2009-03-03 19:30:45 -0800 | [diff] [blame] | 265 | LOCAL_MODULE := strace |
| 266 | |
| 267 | LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES) |
| 268 | |
| 269 | LOCAL_MODULE_TAGS := debug |
| 270 | |
Elliott Hughes | bb0c2d5 | 2014-01-07 17:34:14 -0800 | [diff] [blame] | 271 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
| 272 | |
The Android Open Source Project | 34d6eab | 2009-03-03 19:30:45 -0800 | [diff] [blame] | 273 | include $(BUILD_EXECUTABLE) |
Elliott Hughes | 7c53832 | 2014-02-28 10:32:04 -0800 | [diff] [blame] | 274 | |
Elliott Hughes | 858a5c7 | 2014-02-28 15:58:12 -0800 | [diff] [blame] | 275 | |
Elliott Hughes | 7c53832 | 2014-02-28 10:32:04 -0800 | [diff] [blame] | 276 | # ------------------------------------------------------------------------- |
| 277 | |
Elliott Hughes | 0328d0a | 2015-03-18 11:18:43 -0700 | [diff] [blame] | 278 | # TODO: this is currently broken; the checked in ioctlent*.h files are from the 4.10 release. |
| 279 | |
Elliott Hughes | 7c53832 | 2014-02-28 10:32:04 -0800 | [diff] [blame] | 280 | .PHONY: update-ioctls |
| 281 | update-ioctls: |
| 282 | # Build the generated .h files needed by ioctlsort from the current bionic uapi headers. |
| 283 | cd external/strace; ./linux/ioctlent.sh ../../bionic/libc/kernel/uapi/ |
| 284 | # Build the ioctlsort tool. |
Elliott Hughes | 992aba7 | 2015-01-22 22:44:54 -0800 | [diff] [blame] | 285 | ONE_SHOT_MAKEFILE=external/strace/Android.mk make -f build/core/main.mk $(HOST_OUT_EXECUTABLES)/ioctlsort |
Elliott Hughes | 7c53832 | 2014-02-28 10:32:04 -0800 | [diff] [blame] | 286 | # Remove the generated .h files now we've built ioctlsort. |
| 287 | rm external/strace/ioctls.h external/strace/ioctldefs.h |
Elliott Hughes | 992aba7 | 2015-01-22 22:44:54 -0800 | [diff] [blame] | 288 | # Run the ioctlsort tool to generate the one file we do want to check in. |
| 289 | ioctlsort | tr -d '\r' | sed 's/^\([[:space:]]*{\)"[^"]\+",[[:space:]]*/\1/' | sort -u -k2,2 -k1,1 > external/strace/linux/ioctlent.h |
Elliott Hughes | 7c53832 | 2014-02-28 10:32:04 -0800 | [diff] [blame] | 290 | # Rebuild strace with the new "ioctlent.h". |
Elliott Hughes | 992aba7 | 2015-01-22 22:44:54 -0800 | [diff] [blame] | 291 | ONE_SHOT_MAKEFILE=external/strace/Android.mk make -f build/core/main.mk $(TARGET_OUT_OPTIONAL_EXECUTABLES)/strace |
Elliott Hughes | 7c53832 | 2014-02-28 10:32:04 -0800 | [diff] [blame] | 292 | |
| 293 | # We don't build ioctlsort unless really necessary, because we don't check |
| 294 | # in the temporary files needed to build it. This tool is only necessary |
| 295 | # when updating strace's list of ioctls. |
Elliott Hughes | 992aba7 | 2015-01-22 22:44:54 -0800 | [diff] [blame] | 296 | ifneq (,$(filter $(HOST_OUT_EXECUTABLES)/ioctlsort,$(MAKECMDGOALS))) |
Elliott Hughes | 7c53832 | 2014-02-28 10:32:04 -0800 | [diff] [blame] | 297 | include $(CLEAR_VARS) |
Elliott Hughes | caca6ee | 2015-01-06 12:18:17 -0800 | [diff] [blame] | 298 | LOCAL_SRC_FILES := ioctlsort.c |
Elliott Hughes | 992aba7 | 2015-01-22 22:44:54 -0800 | [diff] [blame] | 299 | # As long as ashmem isn't in glibc, we need the bionic header. |
| 300 | # Unfortunately, it uses __u32 without pulling in a definition, so we need asm/types.h too. |
| 301 | LOCAL_CFLAGS += -include asm/types.h -include bionic/libc/kernel/uapi/linux/ashmem.h |
Elliott Hughes | 7c53832 | 2014-02-28 10:32:04 -0800 | [diff] [blame] | 302 | LOCAL_CFLAGS += -Wno-unused-parameter |
| 303 | LOCAL_MODULE := ioctlsort |
| 304 | LOCAL_MODULE_TAGS := optional |
| 305 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
Elliott Hughes | 992aba7 | 2015-01-22 22:44:54 -0800 | [diff] [blame] | 306 | include $(BUILD_HOST_EXECUTABLE) |
Elliott Hughes | 7c53832 | 2014-02-28 10:32:04 -0800 | [diff] [blame] | 307 | endif |
| 308 | |
| 309 | # ------------------------------------------------------------------------- |