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