]> granicus.if.org Git - strace/blob - Makefile.am
Implement decoding of NS_* ioctl commands
[strace] / Makefile.am
1 # Automake input for strace.
2 #
3 # Copyright (c) 2002-2009 Roland McGrath <roland@redhat.com>
4 # Copyright (c) 2006-2016 Dmitry V. Levin <ldv@altlinux.org>
5 # Copyright (c) 2008-2015 Mike Frysinger <vapier@gentoo.org>
6 # Copyright (c) 2015 Elvira Khabirova <lineprinter0@gmail.com>
7 # All rights reserved.
8 #
9 # Redistribution and use in source and binary forms, with or without
10 # modification, are permitted provided that the following conditions
11 # are met:
12 # 1. Redistributions of source code must retain the above copyright
13 #    notice, this list of conditions and the following disclaimer.
14 # 2. Redistributions in binary form must reproduce the above copyright
15 #    notice, this list of conditions and the following disclaimer in the
16 #    documentation and/or other materials provided with the distribution.
17 # 3. The name of the author may not be used to endorse or promote products
18 #    derived from this software without specific prior written permission.
19 #
20 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
21 # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
22 # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
23 # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
24 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25 # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
31 if HAVE_M32_RUNTIME
32 TESTS_M32 = tests-m32
33 endif
34 if HAVE_MX32_RUNTIME
35 TESTS_MX32 = tests-mx32
36 endif
37 SUBDIRS = tests $(TESTS_M32) $(TESTS_MX32)
38
39 bin_PROGRAMS = strace
40 man_MANS = strace.1
41 bin_SCRIPTS = strace-graph strace-log-merge
42
43 OS              = linux
44 # ARCH is `i386', `m68k', `sparc', etc.
45 ARCH            = @arch@
46
47 ACLOCAL_AMFLAGS = -I m4
48 AM_CFLAGS = $(WARN_CFLAGS)
49 AM_CPPFLAGS = -I$(builddir)/$(OS)/$(ARCH) \
50               -I$(srcdir)/$(OS)/$(ARCH) \
51               -I$(builddir)/$(OS) \
52               -I$(srcdir)/$(OS) \
53               -I$(builddir) \
54               -I$(srcdir)
55
56 AM_CFLAGS_FOR_BUILD = $(WARN_CFLAGS_FOR_BUILD)
57 AM_CPPFLAGS_FOR_BUILD = $(AM_CPPFLAGS)
58
59 include xlat/Makemodule.am
60
61 strace_CPPFLAGS = $(AM_CPPFLAGS)
62 strace_CFLAGS = $(AM_CFLAGS)
63 strace_LDFLAGS =
64 strace_LDADD = libstrace.a
65 noinst_LIBRARIES = libstrace.a
66
67 libstrace_a_CPPFLAGS = $(strace_CPPFLAGS)
68 libstrace_a_CFLAGS = $(strace_CFLAGS)
69 libstrace_a_SOURCES =   \
70         fstatfs.c \
71         fstatfs64.c \
72         ipc.c \
73         sigreturn.c     \
74         socketcall.c \
75         statfs.c \
76         statfs64.c \
77         sync_file_range.c \
78         sync_file_range2.c \
79         upeek.c         \
80         upoke.c         \
81         # end of libstrace_a_SOURCES
82
83 strace_SOURCES =        \
84         access.c        \
85         affinity.c      \
86         aio.c           \
87         alpha.c         \
88         bjm.c           \
89         block.c         \
90         bpf.c           \
91         btrfs.c         \
92         cacheflush.c    \
93         capability.c    \
94         caps0.h         \
95         caps1.h         \
96         chdir.c         \
97         chmod.c         \
98         clone.c         \
99         copy_file_range.c \
100         count.c         \
101         defs.h          \
102         desc.c          \
103         dirent.c        \
104         dirent64.c      \
105         dm.c            \
106         empty.h         \
107         epoll.c         \
108         evdev.c         \
109         eventfd.c       \
110         execve.c        \
111         fadvise.c       \
112         fallocate.c     \
113         fanotify.c      \
114         fchownat.c      \
115         fcntl.c         \
116         fetch_seccomp_fprog.c \
117         fetch_struct_flock.c \
118         fetch_struct_mmsghdr.c \
119         fetch_struct_msghdr.c \
120         fetch_struct_stat.c \
121         fetch_struct_stat64.c \
122         fetch_struct_statfs.c \
123         file_handle.c   \
124         file_ioctl.c    \
125         fs_x_ioctl.c    \
126         flock.c         \
127         flock.h         \
128         futex.c         \
129         gcc_compat.h    \
130         get_robust_list.c \
131         getcpu.c        \
132         getcwd.c        \
133         getrandom.c     \
134         hdio.c          \
135         hostname.c      \
136         inotify.c       \
137         io.c            \
138         ioctl.c         \
139         ioperm.c        \
140         iopl.c          \
141         ioprio.c        \
142         ipc_defs.h      \
143         ipc_msg.c       \
144         ipc_msgctl.c    \
145         ipc_sem.c       \
146         ipc_shm.c       \
147         ipc_shmctl.c    \
148         kcmp.c          \
149         kernel_types.h  \
150         kexec.c         \
151         keyctl.c        \
152         ldt.c           \
153         link.c          \
154         linux/asm_stat.h \
155         linux/x32/asm_stat.h \
156         linux/x86_64/asm_stat.h \
157         lookup_dcookie.c \
158         loop.c          \
159         lseek.c         \
160         mem.c           \
161         membarrier.c    \
162         memfd_create.c  \
163         mknod.c         \
164         mmsghdr.c       \
165         mount.c         \
166         mpers_type.h    \
167         mq.c            \
168         msghdr.c        \
169         msghdr.h        \
170         mtd.c           \
171         native_defs.h   \
172         net.c           \
173         netlink.c       \
174         nsfs.c          \
175         nsfs.h          \
176         nsig.h          \
177         numa.c          \
178         oldstat.c       \
179         open.c          \
180         or1k_atomic.c   \
181         pathtrace.c     \
182         perf.c          \
183         perf_event_struct.h \
184         personality.c   \
185         pkeys.c         \
186         poll.c          \
187         prctl.c         \
188         print_dev_t.c   \
189         print_mq_attr.c \
190         print_msgbuf.c  \
191         print_sg_req_info.c \
192         print_sigevent.c \
193         print_statfs.c  \
194         print_struct_stat.c \
195         print_time.c    \
196         print_timespec.c \
197         print_timeval.c \
198         print_timex.c   \
199         printmode.c     \
200         printrusage.c   \
201         printsiginfo.c  \
202         printsiginfo.h  \
203         process.c       \
204         process_vm.c    \
205         ptp.c           \
206         ptrace.h        \
207         qualify.c       \
208         quota.c         \
209         readahead.c     \
210         readlink.c      \
211         reboot.c        \
212         regs.h          \
213         renameat.c      \
214         resource.c      \
215         rt_sigframe.c   \
216         rt_sigreturn.c  \
217         rtc.c           \
218         sched.c         \
219         sched_attr.h    \
220         scsi.c          \
221         seccomp.c       \
222         seccomp_fprog.h \
223         sendfile.c      \
224         sg_io_v3.c      \
225         sg_io_v4.c      \
226         sigaltstack.c   \
227         sigevent.h      \
228         signal.c        \
229         signalfd.c      \
230         sock.c          \
231         sockaddr.c      \
232         socketutils.c   \
233         sram_alloc.c    \
234         stat.c          \
235         stat.h          \
236         stat64.c        \
237         statfs.c        \
238         statfs.h        \
239         statx.c         \
240         statx.h         \
241         strace.c        \
242         swapon.c        \
243         syscall.c       \
244         sysctl.c        \
245         sysent.h        \
246         sysinfo.c       \
247         syslog.c        \
248         sysmips.c       \
249         term.c          \
250         time.c          \
251         times.c         \
252         truncate.c      \
253         ubi.c           \
254         uid.c           \
255         uid16.c         \
256         umask.c         \
257         umount.c        \
258         uname.c         \
259         userfaultfd.c   \
260         ustat.c         \
261         util.c          \
262         utime.c         \
263         utimes.c        \
264         v4l2.c          \
265         wait.c          \
266         xattr.c         \
267         xlat.h          \
268         xmalloc.c       \
269         # end of strace_SOURCES
270
271 if USE_LIBUNWIND
272 strace_SOURCES += unwind.c
273 strace_CPPFLAGS += $(libunwind_CPPFLAGS)
274 strace_LDFLAGS += $(libunwind_LDFLAGS)
275 strace_LDADD += $(libunwind_LIBS)
276 endif
277
278 @CODE_COVERAGE_RULES@
279 CODE_COVERAGE_BRANCH_COVERAGE = 1
280 CODE_COVERAGE_GENHTML_OPTIONS = $(CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT) \
281         --prefix $(shell cd $(abs_top_srcdir)/.. && pwd || echo .)
282 CODE_COVERAGE_IGNORE_PATTERN = '/usr/include/*'
283 strace_CPPFLAGS += $(CODE_COVERAGE_CPPFLAGS)
284 strace_CFLAGS += $(CODE_COVERAGE_CFLAGS)
285 strace_LDADD += $(CODE_COVERAGE_LDFLAGS)
286
287 # Enable this to get link map generated
288 #strace_LDFLAGS += -Wl,-Map=strace.mapfile
289
290 EXTRA_DIST =                            \
291         $(man_MANS)                     \
292         .version                        \
293         COPYING                         \
294         CREDITS                         \
295         ChangeLog                       \
296         ChangeLog-CVS                   \
297         README-linux-ptrace             \
298         debian/changelog                \
299         debian/compat                   \
300         debian/control                  \
301         debian/copyright                \
302         debian/rules                    \
303         debian/source/format            \
304         debian/strace-udeb.install      \
305         debian/strace.docs              \
306         debian/strace.examples          \
307         debian/strace.install           \
308         debian/strace.manpages          \
309         debian/strace64.install         \
310         debian/strace64.manpages        \
311         debian/watch                    \
312         errnoent.sh                     \
313         generate_sen.sh                 \
314         ioctl_iocdef.c                  \
315         ioctlsort.c                     \
316         linux/32/ioctls_inc.h           \
317         linux/32/ioctls_inc_align16.h   \
318         linux/32/ioctls_inc_align32.h   \
319         linux/32/ioctls_inc_align64.h   \
320         linux/32/syscallent.h           \
321         linux/64/ioctls_inc.h           \
322         linux/64/syscallent.h           \
323         linux/aarch64/arch_regs.c       \
324         linux/aarch64/arch_regs.h       \
325         linux/aarch64/arch_rt_sigframe.c\
326         linux/aarch64/arch_sigreturn.c  \
327         linux/aarch64/errnoent1.h       \
328         linux/aarch64/get_error.c       \
329         linux/aarch64/get_scno.c        \
330         linux/aarch64/get_syscall_args.c\
331         linux/aarch64/ioctls_arch0.h    \
332         linux/aarch64/ioctls_arch1.h    \
333         linux/aarch64/ioctls_inc0.h     \
334         linux/aarch64/ioctls_inc1.h     \
335         linux/aarch64/set_error.c       \
336         linux/aarch64/set_scno.c        \
337         linux/aarch64/signalent1.h      \
338         linux/aarch64/syscallent.h      \
339         linux/aarch64/syscallent1.h     \
340         linux/alpha/arch_getrval2.c     \
341         linux/alpha/arch_regs.c         \
342         linux/alpha/arch_regs.h         \
343         linux/alpha/arch_rt_sigframe.c  \
344         linux/alpha/arch_sigreturn.c    \
345         linux/alpha/errnoent.h          \
346         linux/alpha/get_error.c         \
347         linux/alpha/get_scno.c          \
348         linux/alpha/get_syscall_args.c  \
349         linux/alpha/get_syscall_result.c\
350         linux/alpha/ioctls_arch0.h      \
351         linux/alpha/ioctls_inc0.h       \
352         linux/alpha/set_error.c         \
353         linux/alpha/set_scno.c          \
354         linux/alpha/signalent.h         \
355         linux/alpha/syscallent.h        \
356         linux/alpha/userent.h           \
357         linux/arc/arch_regs.c           \
358         linux/arc/arch_regs.h           \
359         linux/arc/arch_rt_sigframe.c    \
360         linux/arc/get_error.c           \
361         linux/arc/get_scno.c            \
362         linux/arc/get_syscall_args.c    \
363         linux/arc/ioctls_arch0.h        \
364         linux/arc/ioctls_inc0.h         \
365         linux/arc/set_error.c           \
366         linux/arc/set_scno.c            \
367         linux/arc/syscallent.h          \
368         linux/arch_regs.h               \
369         linux/arch_sigreturn.c          \
370         linux/arm/arch_regs.c           \
371         linux/arm/arch_regs.h           \
372         linux/arm/arch_rt_sigframe.c    \
373         linux/arm/arch_sigreturn.c      \
374         linux/arm/get_error.c           \
375         linux/arm/get_scno.c            \
376         linux/arm/get_syscall_args.c    \
377         linux/arm/ioctls_arch0.h        \
378         linux/arm/ioctls_inc0.h         \
379         linux/arm/set_error.c           \
380         linux/arm/set_scno.c            \
381         linux/arm/syscallent.h          \
382         linux/arm/userent.h             \
383         linux/avr32/arch_regs.c         \
384         linux/avr32/arch_regs.h         \
385         linux/avr32/arch_rt_sigframe.c  \
386         linux/avr32/get_error.c         \
387         linux/avr32/get_scno.c          \
388         linux/avr32/get_syscall_args.c  \
389         linux/avr32/ioctls_arch0.h      \
390         linux/avr32/ioctls_inc0.h       \
391         linux/avr32/set_error.c         \
392         linux/avr32/set_scno.c          \
393         linux/avr32/syscallent.h        \
394         linux/avr32/userent.h           \
395         linux/bfin/arch_regs.c          \
396         linux/bfin/arch_rt_sigframe.c   \
397         linux/bfin/get_error.c          \
398         linux/bfin/get_scno.c           \
399         linux/bfin/get_syscall_args.c   \
400         linux/bfin/get_syscall_result.c \
401         linux/bfin/ioctls_arch0.h       \
402         linux/bfin/ioctls_inc0.h        \
403         linux/bfin/rt_sigframe.h        \
404         linux/bfin/set_error.c          \
405         linux/bfin/set_scno.c           \
406         linux/bfin/syscallent.h         \
407         linux/bfin/userent.h            \
408         linux/crisv10/arch_regs.c       \
409         linux/crisv10/arch_rt_sigframe.c\
410         linux/crisv10/arch_sigreturn.c  \
411         linux/crisv10/get_error.c       \
412         linux/crisv10/get_scno.c        \
413         linux/crisv10/get_syscall_args.c        \
414         linux/crisv10/get_syscall_result.c      \
415         linux/crisv10/rt_sigframe.h     \
416         linux/crisv10/set_error.c       \
417         linux/crisv10/set_scno.c        \
418         linux/crisv10/syscallent.h      \
419         linux/crisv10/userent.h         \
420         linux/crisv32/arch_regs.c       \
421         linux/crisv32/arch_rt_sigframe.c\
422         linux/crisv32/arch_sigreturn.c  \
423         linux/crisv32/get_error.c       \
424         linux/crisv32/get_scno.c        \
425         linux/crisv32/get_syscall_args.c        \
426         linux/crisv32/get_syscall_result.c      \
427         linux/crisv32/rt_sigframe.h     \
428         linux/crisv32/set_error.c       \
429         linux/crisv32/set_scno.c        \
430         linux/crisv32/syscallent.h      \
431         linux/crisv32/userent.h         \
432         linux/dummy.h                   \
433         linux/errnoent.h                \
434         linux/getregs_old.h             \
435         linux/hppa/arch_regs.c          \
436         linux/hppa/arch_regs.h          \
437         linux/hppa/arch_rt_sigframe.c   \
438         linux/hppa/errnoent.h           \
439         linux/hppa/get_error.c          \
440         linux/hppa/get_scno.c           \
441         linux/hppa/get_syscall_args.c   \
442         linux/hppa/get_syscall_result.c \
443         linux/hppa/ioctls_arch0.h       \
444         linux/hppa/ioctls_inc0.h        \
445         linux/hppa/rt_sigframe.h        \
446         linux/hppa/set_error.c          \
447         linux/hppa/set_scno.c           \
448         linux/hppa/signalent.h          \
449         linux/hppa/syscallent.h         \
450         linux/i386/arch_regs.c          \
451         linux/i386/arch_regs.h          \
452         linux/i386/arch_rt_sigframe.c   \
453         linux/i386/arch_sigreturn.c     \
454         linux/i386/get_error.c          \
455         linux/i386/get_scno.c           \
456         linux/i386/get_syscall_args.c   \
457         linux/i386/ioctls_arch0.h       \
458         linux/i386/ioctls_inc0.h        \
459         linux/i386/rt_sigframe.h        \
460         linux/i386/set_error.c          \
461         linux/i386/set_scno.c           \
462         linux/i386/syscallent.h         \
463         linux/i386/userent.h            \
464         linux/i386/userent0.h           \
465         linux/ia64/arch_getrval2.c      \
466         linux/ia64/arch_regs.c          \
467         linux/ia64/arch_regs.h          \
468         linux/ia64/arch_rt_sigframe.c   \
469         linux/ia64/get_error.c          \
470         linux/ia64/get_scno.c           \
471         linux/ia64/get_syscall_args.c   \
472         linux/ia64/ioctls_arch0.h       \
473         linux/ia64/ioctls_inc0.h        \
474         linux/ia64/rt_sigframe.h        \
475         linux/ia64/set_error.c          \
476         linux/ia64/set_scno.c           \
477         linux/ia64/syscallent.h         \
478         linux/ia64/userent.h            \
479         linux/inet_diag.h               \
480         linux/m68k/arch_regs.c          \
481         linux/m68k/arch_regs.h          \
482         linux/m68k/arch_rt_sigframe.c   \
483         linux/m68k/arch_sigreturn.c     \
484         linux/m68k/get_error.c          \
485         linux/m68k/get_scno.c           \
486         linux/m68k/get_syscall_args.c   \
487         linux/m68k/ioctls_arch0.h       \
488         linux/m68k/ioctls_inc0.h        \
489         linux/m68k/rt_sigframe.h        \
490         linux/m68k/set_error.c          \
491         linux/m68k/set_scno.c           \
492         linux/m68k/syscallent.h         \
493         linux/m68k/userent.h            \
494         linux/metag/arch_regs.c         \
495         linux/metag/arch_regs.h         \
496         linux/metag/arch_rt_sigframe.c  \
497         linux/metag/get_error.c         \
498         linux/metag/get_scno.c          \
499         linux/metag/get_syscall_args.c  \
500         linux/metag/ioctls_arch0.h      \
501         linux/metag/ioctls_inc0.h       \
502         linux/metag/set_error.c         \
503         linux/metag/set_scno.c          \
504         linux/metag/syscallent.h        \
505         linux/microblaze/arch_regs.c    \
506         linux/microblaze/arch_rt_sigframe.c\
507         linux/microblaze/arch_sigreturn.c       \
508         linux/microblaze/get_error.c    \
509         linux/microblaze/get_scno.c     \
510         linux/microblaze/get_syscall_args.c     \
511         linux/microblaze/get_syscall_result.c   \
512         linux/microblaze/ioctls_arch0.h \
513         linux/microblaze/ioctls_inc0.h  \
514         linux/microblaze/set_error.c    \
515         linux/microblaze/set_scno.c     \
516         linux/microblaze/syscallent.h   \
517         linux/microblaze/userent.h      \
518         linux/mips/arch_getrval2.c      \
519         linux/mips/arch_regs.c          \
520         linux/mips/arch_regs.h          \
521         linux/mips/arch_rt_sigframe.c   \
522         linux/mips/arch_sigreturn.c     \
523         linux/mips/errnoent.h           \
524         linux/mips/genstub.sh           \
525         linux/mips/get_error.c          \
526         linux/mips/get_scno.c           \
527         linux/mips/get_syscall_args.c   \
528         linux/mips/ioctls_arch0.h       \
529         linux/mips/ioctls_inc0.h        \
530         linux/mips/rt_sigframe.h        \
531         linux/mips/set_error.c          \
532         linux/mips/set_scno.c           \
533         linux/mips/signalent.h          \
534         linux/mips/syscallent-compat.h  \
535         linux/mips/syscallent-n32.h     \
536         linux/mips/syscallent-n64.h     \
537         linux/mips/syscallent-o32.h     \
538         linux/mips/syscallent.h         \
539         linux/mips/userent.h            \
540         linux/mtd-abi.h                 \
541         linux/netlink_diag.h            \
542         linux/nios2/arch_regs.c         \
543         linux/nios2/arch_regs.h         \
544         linux/nios2/arch_rt_sigframe.c  \
545         linux/nios2/get_error.c         \
546         linux/nios2/get_scno.c          \
547         linux/nios2/get_syscall_args.c  \
548         linux/nios2/ioctls_arch0.h      \
549         linux/nios2/ioctls_inc0.h       \
550         linux/nios2/set_error.c         \
551         linux/nios2/set_scno.c          \
552         linux/nios2/syscallent.h        \
553         linux/or1k/arch_regs.c          \
554         linux/or1k/arch_regs.h          \
555         linux/or1k/arch_rt_sigframe.c   \
556         linux/or1k/get_error.c          \
557         linux/or1k/get_scno.c           \
558         linux/or1k/get_syscall_args.c   \
559         linux/or1k/ioctls_arch0.h       \
560         linux/or1k/ioctls_inc0.h        \
561         linux/or1k/set_error.c          \
562         linux/or1k/set_scno.c           \
563         linux/or1k/syscallent.h         \
564         linux/or1k/userent.h            \
565         linux/personality.h             \
566         linux/powerpc/arch_regs.c       \
567         linux/powerpc/arch_regs.h       \
568         linux/powerpc/arch_rt_sigframe.c\
569         linux/powerpc/arch_sigreturn.c  \
570         linux/powerpc/errnoent.h        \
571         linux/powerpc/get_error.c       \
572         linux/powerpc/get_scno.c        \
573         linux/powerpc/get_syscall_args.c        \
574         linux/powerpc/getregs_old.c     \
575         linux/powerpc/getregs_old.h     \
576         linux/powerpc/ioctls_arch0.h    \
577         linux/powerpc/ioctls_inc0.h     \
578         linux/powerpc/set_error.c       \
579         linux/powerpc/set_scno.c        \
580         linux/powerpc/syscallent.h      \
581         linux/powerpc/userent.h         \
582         linux/powerpc64/arch_regs.c     \
583         linux/powerpc64/arch_regs.h     \
584         linux/powerpc64/arch_rt_sigframe.c\
585         linux/powerpc64/arch_sigreturn.c        \
586         linux/powerpc64/errnoent.h      \
587         linux/powerpc64/errnoent1.h     \
588         linux/powerpc64/get_error.c     \
589         linux/powerpc64/get_scno.c      \
590         linux/powerpc64/get_syscall_args.c      \
591         linux/powerpc64/getregs_old.c   \
592         linux/powerpc64/getregs_old.h   \
593         linux/powerpc64/ioctls_arch0.h  \
594         linux/powerpc64/ioctls_arch1.h  \
595         linux/powerpc64/ioctls_inc0.h   \
596         linux/powerpc64/ioctls_inc1.h   \
597         linux/powerpc64/rt_sigframe.h   \
598         linux/powerpc64/set_error.c     \
599         linux/powerpc64/set_scno.c      \
600         linux/powerpc64/signalent1.h    \
601         linux/powerpc64/syscallent.h    \
602         linux/powerpc64/syscallent1.h   \
603         linux/powerpc64/userent.h       \
604         linux/ptp_clock.h               \
605         linux/riscv/arch_regs.c         \
606         linux/riscv/arch_regs.h         \
607         linux/riscv/arch_rt_sigframe.c  \
608         linux/riscv/errnoent1.h         \
609         linux/riscv/get_error.c         \
610         linux/riscv/get_scno.c          \
611         linux/riscv/get_syscall_args.c  \
612         linux/riscv/ioctls_arch0.h      \
613         linux/riscv/ioctls_arch1.h      \
614         linux/riscv/ioctls_inc0.h       \
615         linux/riscv/ioctls_inc1.h       \
616         linux/riscv/set_error.c         \
617         linux/riscv/set_scno.c          \
618         linux/riscv/signalent1.h        \
619         linux/riscv/syscallent.h        \
620         linux/riscv/syscallent1.h       \
621         linux/rt_sigframe.h             \
622         linux/s390/arch_regs.c          \
623         linux/s390/arch_regs.h          \
624         linux/s390/arch_rt_sigframe.c   \
625         linux/s390/arch_sigreturn.c     \
626         linux/s390/get_error.c          \
627         linux/s390/get_scno.c           \
628         linux/s390/get_syscall_args.c   \
629         linux/s390/ioctls_arch0.h       \
630         linux/s390/ioctls_inc0.h        \
631         linux/s390/rt_sigframe.h        \
632         linux/s390/set_error.c          \
633         linux/s390/set_scno.c           \
634         linux/s390/syscallent.h         \
635         linux/s390/userent.h            \
636         linux/s390/userent0.h           \
637         linux/s390/userent1.h           \
638         linux/s390x/arch_regs.c         \
639         linux/s390x/arch_regs.h         \
640         linux/s390x/arch_rt_sigframe.c  \
641         linux/s390x/arch_sigreturn.c    \
642         linux/s390x/get_error.c         \
643         linux/s390x/get_scno.c          \
644         linux/s390x/get_syscall_args.c  \
645         linux/s390x/ioctls_arch0.h      \
646         linux/s390x/ioctls_inc0.h       \
647         linux/s390x/rt_sigframe.h       \
648         linux/s390x/set_error.c         \
649         linux/s390x/set_scno.c          \
650         linux/s390x/syscallent.h        \
651         linux/s390x/userent.h           \
652         linux/sh/arch_getrval2.c        \
653         linux/sh/arch_regs.c            \
654         linux/sh/arch_rt_sigframe.c     \
655         linux/sh/get_error.c            \
656         linux/sh/get_scno.c             \
657         linux/sh/get_syscall_args.c     \
658         linux/sh/get_syscall_result.c   \
659         linux/sh/ioctls_arch0.h         \
660         linux/sh/ioctls_inc0.h          \
661         linux/sh/set_error.c            \
662         linux/sh/set_scno.c             \
663         linux/sh/syscallent.h           \
664         linux/sh/userent.h              \
665         linux/sh/userent0.h             \
666         linux/sh64/arch_regs.c          \
667         linux/sh64/arch_regs.h          \
668         linux/sh64/arch_rt_sigframe.c   \
669         linux/sh64/get_error.c          \
670         linux/sh64/get_scno.c           \
671         linux/sh64/get_syscall_args.c   \
672         linux/sh64/get_syscall_result.c \
673         linux/sh64/ioctls_arch0.h       \
674         linux/sh64/ioctls_inc0.h        \
675         linux/sh64/rt_sigframe.h        \
676         linux/sh64/set_error.c          \
677         linux/sh64/set_scno.c           \
678         linux/sh64/syscallent.h         \
679         linux/sh64/userent.h            \
680         linux/signalent.h               \
681         linux/sock_diag.h               \
682         linux/sparc/arch_getrval2.c     \
683         linux/sparc/arch_regs.c         \
684         linux/sparc/arch_regs.h         \
685         linux/sparc/arch_rt_sigframe.c  \
686         linux/sparc/arch_sigreturn.c    \
687         linux/sparc/errnoent.h          \
688         linux/sparc/gen.pl              \
689         linux/sparc/get_error.c         \
690         linux/sparc/get_scno.c          \
691         linux/sparc/get_syscall_args.c  \
692         linux/sparc/ioctls_arch0.h      \
693         linux/sparc/ioctls_inc0.h       \
694         linux/sparc/rt_sigframe.h       \
695         linux/sparc/set_error.c         \
696         linux/sparc/set_scno.c          \
697         linux/sparc/signalent.h         \
698         linux/sparc/syscallent.h        \
699         linux/sparc/userent.h           \
700         linux/sparc64/arch_getrval2.c   \
701         linux/sparc64/arch_regs.c       \
702         linux/sparc64/arch_regs.h       \
703         linux/sparc64/arch_rt_sigframe.c\
704         linux/sparc64/arch_sigreturn.c  \
705         linux/sparc64/errnoent.h        \
706         linux/sparc64/errnoent1.h       \
707         linux/sparc64/get_error.c       \
708         linux/sparc64/get_scno.c        \
709         linux/sparc64/get_syscall_args.c\
710         linux/sparc64/ioctls_arch0.h    \
711         linux/sparc64/ioctls_arch1.h    \
712         linux/sparc64/ioctls_inc0.h     \
713         linux/sparc64/ioctls_inc1.h     \
714         linux/sparc64/rt_sigframe.h     \
715         linux/sparc64/set_error.c       \
716         linux/sparc64/set_scno.c        \
717         linux/sparc64/signalent.h       \
718         linux/sparc64/signalent1.h      \
719         linux/sparc64/syscallent.h      \
720         linux/sparc64/syscallent1.h     \
721         linux/sparc64/userent.h         \
722         linux/subcall.h                 \
723         linux/syscall.h                 \
724         linux/tile/arch_regs.c          \
725         linux/tile/arch_regs.h          \
726         linux/tile/arch_rt_sigframe.c   \
727         linux/tile/arch_sigreturn.c     \
728         linux/tile/errnoent1.h          \
729         linux/tile/get_error.c          \
730         linux/tile/get_scno.c           \
731         linux/tile/get_syscall_args.c   \
732         linux/tile/ioctls_arch0.h       \
733         linux/tile/ioctls_arch1.h       \
734         linux/tile/ioctls_inc0.h        \
735         linux/tile/ioctls_inc1.h        \
736         linux/tile/rt_sigframe.h        \
737         linux/tile/set_error.c          \
738         linux/tile/set_scno.c           \
739         linux/tile/signalent1.h         \
740         linux/tile/syscallent.h         \
741         linux/tile/syscallent1.h        \
742         linux/tile/userent.h            \
743         linux/ubi-user.h                \
744         linux/unix_diag.h               \
745         linux/userent.h                 \
746         linux/userent0.h                \
747         linux/x32/arch_regs.c           \
748         linux/x32/arch_regs.h           \
749         linux/x32/arch_rt_sigframe.c    \
750         linux/x32/arch_sigreturn.c      \
751         linux/x32/errnoent1.h           \
752         linux/x32/get_error.c           \
753         linux/x32/get_scno.c            \
754         linux/x32/get_syscall_args.c    \
755         linux/x32/ioctls_arch0.h        \
756         linux/x32/ioctls_arch1.h        \
757         linux/x32/ioctls_inc0.h         \
758         linux/x32/ioctls_inc1.h         \
759         linux/x32/rt_sigframe.h         \
760         linux/x32/set_error.c           \
761         linux/x32/set_scno.c            \
762         linux/x32/signalent1.h          \
763         linux/x32/syscallent.h          \
764         linux/x32/syscallent1.h         \
765         linux/x32/userent.h             \
766         linux/x86_64/arch_regs.c        \
767         linux/x86_64/arch_regs.h        \
768         linux/x86_64/arch_rt_sigframe.c \
769         linux/x86_64/arch_sigreturn.c   \
770         linux/x86_64/errnoent1.h        \
771         linux/x86_64/errnoent2.h        \
772         linux/x86_64/gentab.pl          \
773         linux/x86_64/get_error.c        \
774         linux/x86_64/get_scno.c         \
775         linux/x86_64/get_syscall_args.c \
776         linux/x86_64/getregs_old.c      \
777         linux/x86_64/getregs_old.h      \
778         linux/x86_64/ioctls_arch0.h     \
779         linux/x86_64/ioctls_arch1.h     \
780         linux/x86_64/ioctls_arch2.h     \
781         linux/x86_64/ioctls_inc0.h      \
782         linux/x86_64/ioctls_inc1.h      \
783         linux/x86_64/ioctls_inc2.h      \
784         linux/x86_64/rt_sigframe.h      \
785         linux/x86_64/set_error.c        \
786         linux/x86_64/set_scno.c         \
787         linux/x86_64/signalent1.h       \
788         linux/x86_64/signalent2.h       \
789         linux/x86_64/syscallent.h       \
790         linux/x86_64/syscallent1.h      \
791         linux/x86_64/syscallent2.h      \
792         linux/x86_64/userent.h          \
793         linux/xtensa/arch_regs.c        \
794         linux/xtensa/arch_rt_sigframe.c \
795         linux/xtensa/get_error.c        \
796         linux/xtensa/get_scno.c         \
797         linux/xtensa/get_syscall_args.c \
798         linux/xtensa/get_syscall_result.c       \
799         linux/xtensa/ioctls_arch0.h     \
800         linux/xtensa/ioctls_inc0.h      \
801         linux/xtensa/set_error.c        \
802         linux/xtensa/set_scno.c         \
803         linux/xtensa/syscallent.h       \
804         linux/xtensa/userent.h          \
805         maint/ioctls_gen.sh             \
806         maint/ioctls_hex.sh             \
807         maint/ioctls_sym.sh             \
808         maint/print_ioctlent.c          \
809         mpers.awk                       \
810         mpers.sh                        \
811         mpers_test.sh                   \
812         mpers_xlat.h                    \
813         scno.head                       \
814         signalent.sh                    \
815         strace-graph                    \
816         strace-log-merge                \
817         strace.spec                     \
818         syscallent.sh                   \
819         $(XLAT_INPUT_FILES)             \
820         $(XLAT_HEADER_FILES)            \
821         xlat/gen.sh                     \
822         xlate.el
823
824 .PHONY: check-valgrind-local
825 check-valgrind-local:
826
827 .PHONY: srpm
828 srpm: dist-xz
829         rpmbuild --define '%_srcrpmdir .' -ts $(distdir).tar.xz
830
831 $(srcdir)/.version:
832         $(AM_V_GEN)echo $(VERSION) > $@-t && mv $@-t $@
833
834 strace_SOURCES_c = \
835         $(filter %.c,$(strace_SOURCES)) $(filter %.c,$(libstrace_a_SOURCES))
836
837 sys_func.h: $(patsubst %,$(srcdir)/%,$(strace_SOURCES_c))
838         for f in $^; do \
839                 sed -n 's/^SYS_FUNC(.*/extern &;/p' $$f; \
840         done | sort -u > $@
841
842 syscallent_names = subcall.h syscallent.h syscallent1.h \
843                    syscallent-n32.h syscallent-n64.h syscallent-o32.h
844 syscallent_patterns = $(patsubst %,\%/%,$(syscallent_names))
845 syscallent_files = $(filter $(syscallent_patterns),$(EXTRA_DIST))
846
847 sen.h: $(patsubst %,$(srcdir)/%,$(syscallent_files))
848         for f in $^; do cat -- $$f; done | \
849                 $(srcdir)/generate_sen.sh > $@
850
851 dist-hook:
852         $(AM_V_GEN)echo $(VERSION) > $(distdir)/.tarball-version
853
854 today = $(shell date +%Y-%m-%d)
855 version_regexp = $(subst .,\.,$(VERSION))
856 news_check_regexp = 'Noteworthy changes in release $(version_regexp) ($(today))'
857
858 news-check: NEWS
859         $(AM_V_GEN)if head -1 $< |                              \
860           grep -x $(news_check_regexp) >/dev/null; then         \
861                 :;                                              \
862         else                                                    \
863                 echo >&2 '$<: check failed';                    \
864                 exit 1;                                         \
865         fi
866
867 ioctlsort_CC = $(CC_FOR_BUILD)
868 ioctlsort_DEFS = $(DEFS)
869 ioctlsort_INCLUDES = $(DEFAULT_INCLUDES) $(INCLUDES)
870 ioctlsort_CPPFLAGS = $(AM_CPPFLAGS_FOR_BUILD) $(CPPFLAGS_FOR_BUILD)
871 ioctlsort_CFLAGS = $(AM_CFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD)
872 ioctlsort_LDFLAGS = $(AM_LDFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD)
873
874 ioctls_inc_h = $(wildcard $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h)
875 ioctlent_h = $(patsubst $(srcdir)/$(OS)/$(ARCH)/ioctls_inc%,ioctlent%,$(ioctls_inc_h))
876 ioctl_redefs_h = $(filter-out ioctl_redefs0.h,$(subst ioctlent,ioctl_redefs,$(ioctlent_h)))
877
878 ioctl_redefs%.h: ioctlent%.h ioctlent0.h
879         sort $< > $<-t
880         sort ioctlent0.h | comm -23 $<-t - | \
881                 sed -r -n 's/^\{ "([^"]+)", (0x[[:xdigit:]]+) \},$$/#ifdef \1\n# undef \1\n# define \1 \2\n#endif/p' \
882                 > $@-t
883         rm -f $<-t
884         mv $@-t $@
885
886 ioctlent%.h: ioctlsort%
887         ./$< > $@
888
889 # Need to pick up <linux/ioctl.h> definitions *for host* while compiling
890 # ioctlsort *for build*, hence this magic.
891 ioctl_iocdef.i: $(srcdir)/ioctl_iocdef.c
892         $(CPP) -P $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
893                 $(strace_CPPFLAGS) $(CPPFLAGS) $< -o $@
894
895 ioctl_iocdef.h: ioctl_iocdef.i
896         sed -n 's/^DEFINE HOST/#define /p' $< > $@
897
898 ioctlsort%$(BUILD_EXEEXT): ioctlsort%.o
899         $(ioctlsort_CC) $(ioctlsort_CFLAGS) $(ioctlsort_LDFLAGS) $< -o $@
900
901 ioctlsort%.o: ioctls_all%.h ioctl_iocdef.h $(srcdir)/ioctlsort.c
902         $(ioctlsort_CC) $(ioctlsort_DEFS) $(ioctlsort_INCLUDES) $(ioctlsort_CPPFLAGS) $(ioctlsort_CFLAGS) -DIOCTLSORT_INC=\"$<\" -c -o $@ $(srcdir)/ioctlsort.c
903
904 ioctls_all%.h: $(srcdir)/$(OS)/$(ARCH)/ioctls_inc%.h $(srcdir)/$(OS)/$(ARCH)/ioctls_arch%.h
905         cat $^ > $@
906
907 BUILT_SOURCES = $(ioctl_redefs_h) $(ioctlent_h) \
908                 native_printer_decls.h native_printer_defs.h printers.h sen.h sys_func.h .version
909 CLEANFILES    = $(ioctl_redefs_h) $(ioctlent_h) $(mpers_preproc_files) \
910                 ioctl_iocdef.h ioctl_iocdef.i \
911                 native_printer_decls.h native_printer_defs.h printers.h sen.h sys_func.h
912 DISTCLEANFILES = gnu/stubs-32.h gnu/stubs-x32.h
913
914 include scno.am
915
916 $(strace_OBJECTS): scno.h
917
918 # defines mpers_source_files
919 include mpers.am
920 srcdir_mpers_source_files = $(patsubst %,$(srcdir)/%,$(mpers_source_files))
921 mpers_preproc_files = $(mpers_source_files:.c=.c.mpers.i)
922
923 mpers_NAME =
924 mpers_PREFIX = $(mpers_NAME)_
925 mpers_DEFS = $(DEFS)
926 mpers_INCLUDES = $(DEFAULT_INCLUDES) $(INCLUDES)
927 mpers_CPPFLAGS = $(strace_CPPFLAGS) $(CPPFLAGS)
928 mpers_sh_opts = $(mpers_DEFS) $(mpers_INCLUDES) $(mpers_CPPFLAGS)
929 libmpers_CPPFLAGS = $(strace_CPPFLAGS) -DIN_MPERS
930 libmpers_CFLAGS = $(strace_CFLAGS)
931
932 # mpers targets
933
934 mpers-m%.stamp: $(srcdir_mpers_source_files) | printers.h
935         for f in $^; do \
936                 CC="$(CC)" CFLAGS="$(mpers_sh_opts) -DMPERS_IS_$(mpers_NAME)" \
937                 CPP="$(CPP)" CPPFLAGS="$(mpers_sh_opts) -DIN_MPERS -DMPERS_IS_$(mpers_NAME)" \
938                 $(srcdir)/mpers.sh -$(mpers_NAME) $$f || exit; \
939         done
940         > $@
941
942 m%_type_defs.h: $(srcdir_mpers_source_files)
943         for f in $^; do \
944                 sed -r -n 's/^#[[:space:]]*include DEF_MPERS_TYPE\(([^)]+)\)/#ifdef MPERS_$(mpers_PREFIX)\1\n# define \1 MPERS_$(mpers_PREFIX)\1\n#endif/p' $$f || exit; \
945         done > $@-t
946         echo '#undef MPERS_PRINTER_NAME' >> $@-t
947         echo '#define MPERS_PRINTER_NAME(printer_name) printer_name' >> $@-t
948         echo '#include "$(mpers_PREFIX)printer_decls.h"' >> $@-t
949         echo '#include MPERS_$(mpers_PREFIX)IOCTL_MACROS' >> $@-t
950         mv $@-t $@
951
952 m%_funcs.h: $(srcdir_mpers_source_files)
953         for f in $^; do \
954                 sed -r -n 's/^SYS_FUNC\(([^)]+)\)/#undef sys_\1\n#define sys_\1 $(mpers_PREFIX)sys_\1/p' $$f || exit; \
955         done > $@-t && \
956         echo '#include "sys_func.h"' >> $@-t
957         mv $@-t $@
958
959 # printers
960
961 %.c.mpers.i: $(srcdir)/%.c
962         $(CPP) -P $(mpers_sh_opts) -DIN_MPERS_BOOTSTRAP $< -o $@
963
964 mpers_printer_decl_pattern = ^MPERS_PRINTER_DECL\(([^,)]+),[[:space:]]*([^,)]+),[[:space:]]*([^)]+)\)$$
965
966 printers.h: $(mpers_preproc_files)
967         echo '/* Generated by Makefile from $^; do not edit. */' > $@-t
968         echo 'typedef struct {' >> $@-t
969         for f in $^; do \
970                 sed -r -n 's/$(mpers_printer_decl_pattern)/ \1 (*\2)(\3);\n#define \2 MPERS_PRINTER_NAME(\2)\n/p' $$f \
971                 || exit; \
972         done >> $@-t
973         echo '} struct_printers;' >> $@-t
974         echo 'extern const struct_printers *printers;' >> $@-t
975         echo '#define MPERS_PRINTER_NAME(printer_name) printers->printer_name' >> $@-t
976         mv $@-t $@
977
978 %_printer_decls.h: $(mpers_preproc_files)
979         echo '/* Generated by Makefile from $^; do not edit. */' > $@-t
980         for f in $^; do \
981                 sed -r -n 's/$(mpers_printer_decl_pattern)/extern \1 $(mpers_PREFIX)\2(\3);/p' $$f \
982                 || exit; \
983         done >> $@-t
984         mv $@-t $@
985
986 %_printer_defs.h: $(mpers_preproc_files)
987         echo '/* Generated by Makefile from $^; do not edit. */' > $@-t
988         for f in $^; do \
989                 sed -r -n 's/$(mpers_printer_decl_pattern)/.\2 = $(mpers_PREFIX)\2,/p' $$f \
990                 || exit; \
991         done >> $@-t
992         mv $@-t $@
993
994 native_printer_decls.h native_printer_defs.h: mpers_PREFIX =
995
996 if HAVE_M32_MPERS
997
998 strace_LDADD += libmpers-m32.a
999 noinst_LIBRARIES += libmpers-m32.a
1000 libmpers_m32_a_SOURCES = $(mpers_source_files)
1001 libmpers_m32_a_CPPFLAGS = $(libmpers_CPPFLAGS) -DMPERS_IS_m32 -I$(builddir)/mpers-m32
1002 libmpers_m32_a_CFLAGS = $(libmpers_CFLAGS)
1003 mpers_m32_targets = mpers-m32.stamp m32_type_defs.h m32_funcs.h m32_printer_decls.h m32_printer_defs.h
1004
1005 BUILT_SOURCES += $(mpers_m32_targets)
1006 CLEANFILES    += $(mpers_m32_targets)
1007
1008 $(mpers_m32_targets): mpers_NAME = m32
1009
1010 endif # HAVE_M32_MPERS
1011
1012 if HAVE_MX32_MPERS
1013
1014 strace_LDADD += libmpers-mx32.a
1015 noinst_LIBRARIES += libmpers-mx32.a
1016 libmpers_mx32_a_SOURCES = $(mpers_source_files)
1017 libmpers_mx32_a_CPPFLAGS = $(libmpers_CPPFLAGS) -DMPERS_IS_mx32 -I$(builddir)/mpers-mx32
1018 libmpers_mx32_a_CFLAGS = $(libmpers_CFLAGS)
1019 mpers_mx32_targets = mpers-mx32.stamp mx32_type_defs.h mx32_funcs.h mx32_printer_decls.h mx32_printer_defs.h
1020
1021 BUILT_SOURCES += $(mpers_mx32_targets)
1022 CLEANFILES    += $(mpers_mx32_targets)
1023
1024 $(mpers_mx32_targets): mpers_NAME = mx32
1025
1026 endif # HAVE_MX32_MPERS
1027
1028 clean-local:
1029         -rm -rf mpers-m32 mpers-mx32
1030
1031 if MAINTAINER_MODE
1032
1033 gen_changelog_start_date = 2009-07-08 20:00
1034 $(srcdir)/ChangeLog: $(srcdir)/gitlog-to-changelog $(srcdir)/Makefile.in \
1035                      $(srcdir)/.version
1036         @rm -f $@.new
1037         (cd $(srcdir); \
1038          ./gitlog-to-changelog --append-dot \
1039            --since='$(gen_changelog_start_date)'; \
1040          echo; echo; echo 'See ChangeLog-CVS for older changes.' \
1041         ) > $@.new
1042         chmod 444 $@.new
1043         mv -f $@.new $@
1044
1045 $(srcdir)/CREDITS: $(srcdir)/CREDITS.in $(srcdir)/.mailmap \
1046                    $(srcdir)/Makefile.in $(srcdir)/.version
1047         $(AM_V_GEN)                                                     \
1048         (                                                               \
1049           cd $(srcdir);                                                 \
1050           sed '/^##/,$$d' CREDITS.in;                                   \
1051           { sed -n '1,/^##>/d; s/   */\t/; s/^./&/p' CREDITS.in;        \
1052             git log --pretty=format:'%aN        %aE';                   \
1053           } | LC_ALL=C sort -u                                          \
1054             | awk -F'\t' '{printf("\t%s <%s>\n",$$1,$$2)}';             \
1055         ) > $@-t && mv $@-t $@
1056
1057 export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner --mode=go-w,go+rX
1058
1059 endif