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