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