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