]> granicus.if.org Git - strace/blob - Makefile.am
clone: fix print_tls_arg on x86
[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         flock.c         \
133         flock.h         \
134         fs_x_ioctl.c    \
135         fsconfig.c      \
136         fsmount.c       \
137         fsopen.c        \
138         fspick.c        \
139         futex.c         \
140         gcc_compat.h    \
141         get_personality.c \
142         get_personality.h \
143         get_robust_list.c \
144         getcpu.c        \
145         getcwd.c        \
146         getrandom.c     \
147         hdio.c          \
148         hostname.c      \
149         inotify.c       \
150         inotify_ioctl.c \
151         io.c            \
152         io_uring.c      \
153         ioctl.c         \
154         ioperm.c        \
155         iopl.c          \
156         ioprio.c        \
157         ipc_defs.h      \
158         ipc_msg.c       \
159         ipc_msgctl.c    \
160         ipc_sem.c       \
161         ipc_shm.c       \
162         ipc_shmctl.c    \
163         kcmp.c          \
164         kernel_timespec.h \
165         kernel_timeval.h \
166         kernel_timex.h  \
167         kernel_types.h  \
168         kexec.c         \
169         keyctl.c        \
170         keyctl_kdf_params.h \
171         kill_save_errno.h \
172         kvm.c           \
173         largefile_wrappers.h \
174         ldt.c           \
175         link.c          \
176         linux/asm_stat.h \
177         linux/x32/asm_stat.h \
178         linux/x86_64/asm_stat.h \
179         list.h          \
180         listen.c        \
181         lookup_dcookie.c \
182         loop.c          \
183         lseek.c         \
184         macros.h        \
185         mem.c           \
186         membarrier.c    \
187         memfd_create.c  \
188         mknod.c         \
189         mmap_notify.c   \
190         mmap_notify.h   \
191         mmsghdr.c       \
192         mount.c         \
193         move_mount.c    \
194         mpers_type.h    \
195         mq.c            \
196         msghdr.c        \
197         msghdr.h        \
198         mtd.c           \
199         native_defs.h   \
200         nbd_ioctl.c     \
201         negated_errno.h \
202         net.c           \
203         netlink.c       \
204         netlink.h       \
205         netlink_crypto.c \
206         netlink_inet_diag.c \
207         netlink_kobject_uevent.c \
208         netlink_kobject_uevent.h \
209         netlink_netfilter.c \
210         netlink_netlink_diag.c \
211         netlink_packet_diag.c \
212         netlink_route.c \
213         netlink_route.h \
214         netlink_selinux.c \
215         netlink_smc_diag.c \
216         netlink_sock_diag.c \
217         netlink_sock_diag.h \
218         netlink_unix_diag.c \
219         nlattr.c        \
220         nlattr.h        \
221         nsfs.c          \
222         nsfs.h          \
223         nsig.h          \
224         numa.c          \
225         number_set.c    \
226         number_set.h    \
227         oldstat.c       \
228         open.c          \
229         open_tree.c     \
230         or1k_atomic.c   \
231         pathtrace.c     \
232         perf.c          \
233         perf_event_struct.h \
234         perf_ioctl.c    \
235         personality.c   \
236         pidfd_open.c    \
237         pkeys.c         \
238         poll.c          \
239         prctl.c         \
240         print_aio_sigset.c \
241         print_dev_t.c   \
242         print_fields.h  \
243         print_group_req.c \
244         print_ifindex.c \
245         print_instruction_pointer.c \
246         print_kernel_version.c \
247         print_mac.c     \
248         print_mq_attr.c \
249         print_msgbuf.c  \
250         print_sg_req_info.c \
251         print_sigevent.c \
252         print_statfs.c  \
253         print_struct_stat.c \
254         print_time.c    \
255         print_timespec.c \
256         print_timespec.h \
257         print_timespec32.c \
258         print_timespec64.c \
259         print_timeval.c \
260         print_timeval64.c \
261         print_timex.c   \
262         print_timex.h   \
263         print_utils.h   \
264         printmode.c     \
265         printrusage.c   \
266         printsiginfo.c  \
267         printsiginfo.h  \
268         process.c       \
269         process_vm.c    \
270         ptp.c           \
271         ptrace.h        \
272         ptrace_syscall_info.c \
273         ptrace_syscall_info.h \
274         quota.c         \
275         random_ioctl.c  \
276         readahead.c     \
277         readlink.c      \
278         reboot.c        \
279         regs.h          \
280         renameat.c      \
281         resource.c      \
282         retval.c        \
283         retval.h        \
284         riscv.c         \
285         rt_sigframe.c   \
286         rt_sigreturn.c  \
287         rtc.c           \
288         rtnl_addr.c     \
289         rtnl_addrlabel.c \
290         rtnl_dcb.c      \
291         rtnl_link.c     \
292         rtnl_mdb.c      \
293         rtnl_neigh.c    \
294         rtnl_neightbl.c \
295         rtnl_netconf.c  \
296         rtnl_nsid.c     \
297         rtnl_route.c    \
298         rtnl_rule.c     \
299         rtnl_tc.c       \
300         rtnl_tc_action.c \
301         s390.c          \
302         sched.c         \
303         sched_attr.h    \
304         scsi.c          \
305         seccomp.c       \
306         sendfile.c      \
307         sg_io_v3.c      \
308         sg_io_v4.c      \
309         shutdown.c      \
310         sigaltstack.c   \
311         sigevent.h      \
312         signal.c        \
313         signalfd.c      \
314         sock.c          \
315         sockaddr.c      \
316         socketutils.c   \
317         sparc.c         \
318         sram_alloc.c    \
319         stage_output.c  \
320         stat.c          \
321         stat.h          \
322         stat64.c        \
323         statfs.c        \
324         statfs.h        \
325         static_assert.h \
326         statx.c         \
327         statx.h         \
328         strace.c        \
329         string_to_uint.c \
330         string_to_uint.h \
331         swapon.c        \
332         syscall.c       \
333         sysctl.c        \
334         sysent.h        \
335         sysent_shorthand_defs.h \
336         sysent_shorthand_undefs.h \
337         sysinfo.c       \
338         syslog.c        \
339         sysmips.c       \
340         term.c          \
341         time.c          \
342         times.c         \
343         trace_event.h   \
344         truncate.c      \
345         ubi.c           \
346         ucopy.c         \
347         uid.c           \
348         uid16.c         \
349         umask.c         \
350         umount.c        \
351         uname.c         \
352         userfaultfd.c   \
353         ustat.c         \
354         util.c          \
355         utime.c         \
356         utimes.c        \
357         v4l2.c          \
358         wait.c          \
359         wait.h          \
360         watchdog_ioctl.c \
361         xattr.c         \
362         xfs_quota_stat.h \
363         xlat.c          \
364         xlat.h          \
365         xmalloc.c       \
366         xmalloc.h       \
367         xstring.h       \
368         $(strace_SOURCES_check) \
369         # end of strace_SOURCES
370
371 strace_SOURCES_check = bpf_attr_check.c
372
373 if ENABLE_STACKTRACE
374 strace_SOURCES += unwind.c unwind.h
375 if USE_LIBDW
376 strace_SOURCES += unwind-libdw.c
377 strace_CPPFLAGS += $(libdw_CPPFLAGS)
378 strace_CFLAGS += $(libdw_CFLAGS)
379 strace_LDFLAGS += $(libdw_LDFLAGS)
380 strace_LDADD += $(libdw_LIBS)
381 endif
382 if USE_LIBUNWIND
383 strace_SOURCES += unwind-libunwind.c
384 strace_CPPFLAGS += $(libunwind_CPPFLAGS)
385 strace_LDFLAGS += $(libunwind_LDFLAGS)
386 strace_LDADD += $(libunwind_LIBS)
387 endif
388 if USE_DEMANGLE
389 strace_CPPFLAGS += $(libiberty_CPPFLAGS)
390 strace_LDFLAGS += $(libiberty_LDFLAGS)
391 strace_LDADD += $(libiberty_LIBS)
392 endif
393 endif
394
395 @CODE_COVERAGE_RULES@
396 CODE_COVERAGE_BRANCH_COVERAGE = 1
397 CODE_COVERAGE_GENHTML_OPTIONS = $(CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT) \
398         --prefix $(shell cd $(abs_top_srcdir)/.. && pwd || echo .)
399 CODE_COVERAGE_IGNORE_PATTERN = '/usr/include/*'
400 strace_CPPFLAGS += $(CODE_COVERAGE_CPPFLAGS)
401 strace_CFLAGS += $(CODE_COVERAGE_CFLAGS)
402 strace_LDADD += $(CODE_COVERAGE_LIBS)
403
404 # Enable this to get link map generated
405 #strace_LDFLAGS += -Wl,-Map=strace.mapfile
406
407 EXTRA_DIST =                            \
408         $(man_MANS)                     \
409         .version                        \
410         COPYING                         \
411         CREDITS                         \
412         ChangeLog                       \
413         ChangeLog-CVS                   \
414         LGPL-2.1-or-later               \
415         README-configure                \
416         README-linux-ptrace             \
417         debian/changelog                \
418         debian/compat                   \
419         debian/control                  \
420         debian/copyright                \
421         debian/rules                    \
422         debian/source/format            \
423         debian/strace-udeb.install      \
424         debian/strace.docs              \
425         debian/strace.examples          \
426         debian/strace.install           \
427         debian/strace.manpages          \
428         debian/strace64.install         \
429         debian/strace64.manpages        \
430         debian/watch                    \
431         gen_bpf_attr_check.sh           \
432         generate_sen.sh                 \
433         ioctl_iocdef.c                  \
434         ioctlsort.c                     \
435         linux/32/ioctls_inc.h           \
436         linux/32/ioctls_inc_align16.h   \
437         linux/32/ioctls_inc_align32.h   \
438         linux/32/ioctls_inc_align64.h   \
439         linux/32/syscallent.h           \
440         linux/64/ioctls_inc.h           \
441         linux/64/syscallent.h           \
442         linux/aarch64/arch_defs_.h      \
443         linux/aarch64/arch_get_personality.c \
444         linux/aarch64/arch_regs.c       \
445         linux/aarch64/arch_sigreturn.c  \
446         linux/aarch64/get_error.c       \
447         linux/aarch64/get_scno.c        \
448         linux/aarch64/get_syscall_args.c        \
449         linux/aarch64/ioctls_arch0.h    \
450         linux/aarch64/ioctls_arch1.h    \
451         linux/aarch64/ioctls_inc0.h     \
452         linux/aarch64/ioctls_inc1.h     \
453         linux/aarch64/nr_prefix.c       \
454         linux/aarch64/raw_syscall.h     \
455         linux/aarch64/set_error.c       \
456         linux/aarch64/set_scno.c        \
457         linux/aarch64/shuffle_scno.c    \
458         linux/aarch64/syscallent.h      \
459         linux/aarch64/syscallent1.h     \
460         linux/alpha/arch_defs_.h        \
461         linux/alpha/arch_getrval2.c     \
462         linux/alpha/arch_regs.c         \
463         linux/alpha/arch_sigreturn.c    \
464         linux/alpha/errnoent.h          \
465         linux/alpha/get_error.c         \
466         linux/alpha/get_scno.c          \
467         linux/alpha/get_syscall_args.c  \
468         linux/alpha/get_syscall_result.c        \
469         linux/alpha/ioctls_arch0.h      \
470         linux/alpha/ioctls_inc0.h       \
471         linux/alpha/raw_syscall.h       \
472         linux/alpha/set_error.c         \
473         linux/alpha/set_scno.c          \
474         linux/alpha/signalent.h         \
475         linux/alpha/syscallent.h        \
476         linux/alpha/userent.h           \
477         linux/arc/arch_regs.c           \
478         linux/arc/get_error.c           \
479         linux/arc/get_scno.c            \
480         linux/arc/get_syscall_args.c    \
481         linux/arc/ioctls_arch0.h        \
482         linux/arc/ioctls_inc0.h         \
483         linux/arc/raw_syscall.h         \
484         linux/arc/set_error.c           \
485         linux/arc/set_scno.c            \
486         linux/arc/syscallent.h          \
487         linux/arch_defs_.h              \
488         linux/arch_kvm.c                \
489         linux/arch_regs.h               \
490         linux/arch_rt_sigframe.c        \
491         linux/arch_sigreturn.c          \
492         linux/arm/arch_defs_.h          \
493         linux/arm/arch_regs.c           \
494         linux/arm/arch_sigreturn.c      \
495         linux/arm/get_error.c           \
496         linux/arm/get_scno.c            \
497         linux/arm/get_syscall_args.c    \
498         linux/arm/ioctls_arch0.h        \
499         linux/arm/ioctls_inc0.h         \
500         linux/arm/nr_prefix.c           \
501         linux/arm/raw_syscall.h         \
502         linux/arm/set_error.c           \
503         linux/arm/set_scno.c            \
504         linux/arm/shuffle_scno.c        \
505         linux/arm/syscallent.h          \
506         linux/arm/userent.h             \
507         linux/avr32/arch_regs.c         \
508         linux/avr32/get_error.c         \
509         linux/avr32/get_scno.c          \
510         linux/avr32/get_syscall_args.c  \
511         linux/avr32/ioctls_arch0.h      \
512         linux/avr32/ioctls_inc0.h       \
513         linux/avr32/raw_syscall.h       \
514         linux/avr32/set_error.c         \
515         linux/avr32/set_scno.c          \
516         linux/avr32/syscallent.h        \
517         linux/avr32/userent.h           \
518         linux/bfin/arch_defs_.h         \
519         linux/bfin/arch_regs.c          \
520         linux/bfin/get_error.c          \
521         linux/bfin/get_scno.c           \
522         linux/bfin/get_syscall_args.c   \
523         linux/bfin/get_syscall_result.c \
524         linux/bfin/ioctls_arch0.h       \
525         linux/bfin/ioctls_inc0.h        \
526         linux/bfin/raw_syscall.h        \
527         linux/bfin/rt_sigframe.h        \
528         linux/bfin/set_error.c          \
529         linux/bfin/set_scno.c           \
530         linux/bfin/syscallent.h         \
531         linux/csky/arch_regs.c          \
532         linux/csky/get_error.c          \
533         linux/csky/get_scno.c           \
534         linux/csky/get_syscall_args.c   \
535         linux/csky/ioctls_arch0.h       \
536         linux/csky/ioctls_inc0.h        \
537         linux/csky/raw_syscall.h        \
538         linux/csky/set_error.c          \
539         linux/csky/set_scno.c           \
540         linux/csky/syscallent.h         \
541         linux/bfin/userent.h            \
542         linux/check_scno.c              \
543         linux/dummy.h                   \
544         linux/errnoent.h                \
545         linux/getregs_old.h             \
546         linux/hppa/arch_defs_.h         \
547         linux/hppa/arch_regs.c          \
548         linux/hppa/arch_rt_sigframe.c   \
549         linux/hppa/errnoent.h           \
550         linux/hppa/get_error.c          \
551         linux/hppa/get_scno.c           \
552         linux/hppa/get_syscall_args.c   \
553         linux/hppa/get_syscall_result.c \
554         linux/hppa/ioctls_arch0.h       \
555         linux/hppa/ioctls_inc0.h        \
556         linux/hppa/raw_syscall.h        \
557         linux/hppa/rt_sigframe.h        \
558         linux/hppa/set_error.c          \
559         linux/hppa/set_scno.c           \
560         linux/hppa/signalent.h          \
561         linux/hppa/syscallent.h         \
562         linux/hppa/userent.h            \
563         linux/i386/arch_defs_.h         \
564         linux/i386/arch_kvm.c           \
565         linux/i386/arch_regs.c          \
566         linux/i386/arch_rt_sigframe.c   \
567         linux/i386/arch_sigreturn.c     \
568         linux/i386/get_error.c          \
569         linux/i386/get_scno.c           \
570         linux/i386/get_syscall_args.c   \
571         linux/i386/ioctls_arch0.h       \
572         linux/i386/ioctls_inc0.h        \
573         linux/i386/raw_syscall.h        \
574         linux/i386/rt_sigframe.h        \
575         linux/i386/set_error.c          \
576         linux/i386/set_scno.c           \
577         linux/i386/syscallent.h         \
578         linux/i386/userent.h            \
579         linux/i386/userent0.h           \
580         linux/ia64/arch_defs_.h         \
581         linux/ia64/arch_getrval2.c      \
582         linux/ia64/arch_regs.c          \
583         linux/ia64/arch_regs.h          \
584         linux/ia64/arch_rt_sigframe.c   \
585         linux/ia64/get_error.c          \
586         linux/ia64/get_scno.c           \
587         linux/ia64/get_syscall_args.c   \
588         linux/ia64/ioctls_arch0.h       \
589         linux/ia64/ioctls_inc0.h        \
590         linux/ia64/raw_syscall.h        \
591         linux/ia64/rt_sigframe.h        \
592         linux/ia64/set_error.c          \
593         linux/ia64/set_scno.c           \
594         linux/ia64/shuffle_scno.c       \
595         linux/ia64/syscallent.h         \
596         linux/ia64/syscallent_base_nr.h \
597         linux/ia64/userent.h            \
598         linux/inet_diag.h               \
599         linux/m68k/arch_defs_.h         \
600         linux/m68k/arch_regs.c          \
601         linux/m68k/arch_rt_sigframe.c   \
602         linux/m68k/arch_sigreturn.c     \
603         linux/m68k/get_error.c          \
604         linux/m68k/get_scno.c           \
605         linux/m68k/get_syscall_args.c   \
606         linux/m68k/ioctls_arch0.h       \
607         linux/m68k/ioctls_inc0.h        \
608         linux/m68k/raw_syscall.h        \
609         linux/m68k/rt_sigframe.h        \
610         linux/m68k/set_error.c          \
611         linux/m68k/set_scno.c           \
612         linux/m68k/syscallent.h         \
613         linux/m68k/userent.h            \
614         linux/metag/arch_regs.c         \
615         linux/metag/arch_rt_sigframe.c  \
616         linux/metag/get_error.c         \
617         linux/metag/get_scno.c          \
618         linux/metag/get_syscall_args.c  \
619         linux/metag/ioctls_arch0.h      \
620         linux/metag/ioctls_inc0.h       \
621         linux/metag/raw_syscall.h       \
622         linux/metag/set_error.c         \
623         linux/metag/set_scno.c          \
624         linux/metag/syscallent.h        \
625         linux/microblaze/arch_defs_.h   \
626         linux/microblaze/arch_regs.c    \
627         linux/microblaze/arch_sigreturn.c       \
628         linux/microblaze/get_error.c    \
629         linux/microblaze/get_scno.c     \
630         linux/microblaze/get_syscall_args.c     \
631         linux/microblaze/get_syscall_result.c   \
632         linux/microblaze/ioctls_arch0.h \
633         linux/microblaze/ioctls_inc0.h  \
634         linux/microblaze/raw_syscall.h  \
635         linux/microblaze/set_error.c    \
636         linux/microblaze/set_scno.c     \
637         linux/microblaze/syscallent.h   \
638         linux/microblaze/userent.h      \
639         linux/mips/arch_defs_.h         \
640         linux/mips/arch_getrval2.c      \
641         linux/mips/arch_regs.c          \
642         linux/mips/arch_sigreturn.c     \
643         linux/mips/errnoent.h           \
644         linux/mips/genstub.sh           \
645         linux/mips/get_error.c          \
646         linux/mips/get_scno.c           \
647         linux/mips/get_syscall_args.c   \
648         linux/mips/ioctls_arch0.h       \
649         linux/mips/ioctls_inc0.h        \
650         linux/mips/raw_syscall.h        \
651         linux/mips/rt_sigframe.h        \
652         linux/mips/set_error.c          \
653         linux/mips/set_scno.c           \
654         linux/mips/signalent.h          \
655         linux/mips/syscallent-compat.h  \
656         linux/mips/syscallent-n32.h     \
657         linux/mips/syscallent-n64.h     \
658         linux/mips/syscallent-o32.h     \
659         linux/mips/syscallent.h         \
660         linux/mips/userent.h            \
661         linux/netlink_diag.h            \
662         linux/nios2/arch_defs_.h        \
663         linux/nios2/arch_regs.c         \
664         linux/nios2/get_error.c         \
665         linux/nios2/get_scno.c          \
666         linux/nios2/get_syscall_args.c  \
667         linux/nios2/ioctls_arch0.h      \
668         linux/nios2/ioctls_inc0.h       \
669         linux/nios2/raw_syscall.h       \
670         linux/nios2/set_error.c         \
671         linux/nios2/set_scno.c          \
672         linux/nios2/syscallent.h        \
673         linux/nr_prefix.c               \
674         linux/or1k/arch_regs.c          \
675         linux/or1k/get_error.c          \
676         linux/or1k/get_scno.c           \
677         linux/or1k/get_syscall_args.c   \
678         linux/or1k/ioctls_arch0.h       \
679         linux/or1k/ioctls_inc0.h        \
680         linux/or1k/raw_syscall.h        \
681         linux/or1k/set_error.c          \
682         linux/or1k/set_scno.c           \
683         linux/or1k/syscallent.h         \
684         linux/or1k/userent.h            \
685         linux/packet_diag.h             \
686         linux/powerpc/arch_defs_.h      \
687         linux/powerpc/arch_regs.c       \
688         linux/powerpc/arch_rt_sigframe.c        \
689         linux/powerpc/arch_sigreturn.c  \
690         linux/powerpc/errnoent.h        \
691         linux/powerpc/get_error.c       \
692         linux/powerpc/get_scno.c        \
693         linux/powerpc/get_syscall_args.c        \
694         linux/powerpc/getregs_old.c     \
695         linux/powerpc/getregs_old.h     \
696         linux/powerpc/ioctls_arch0.h    \
697         linux/powerpc/ioctls_inc0.h     \
698         linux/powerpc/raw_syscall.h     \
699         linux/powerpc/set_error.c       \
700         linux/powerpc/set_scno.c        \
701         linux/powerpc/syscallent.h      \
702         linux/powerpc/userent.h         \
703         linux/powerpc64/arch_defs_.h    \
704         linux/powerpc64/arch_get_personality.c \
705         linux/powerpc64/arch_regs.c     \
706         linux/powerpc64/arch_rt_sigframe.c      \
707         linux/powerpc64/arch_sigreturn.c        \
708         linux/powerpc64/errnoent.h      \
709         linux/powerpc64/get_error.c     \
710         linux/powerpc64/get_scno.c      \
711         linux/powerpc64/get_syscall_args.c      \
712         linux/powerpc64/getregs_old.c   \
713         linux/powerpc64/getregs_old.h   \
714         linux/powerpc64/ioctls_arch0.h  \
715         linux/powerpc64/ioctls_arch1.h  \
716         linux/powerpc64/ioctls_inc0.h   \
717         linux/powerpc64/ioctls_inc1.h   \
718         linux/powerpc64/raw_syscall.h   \
719         linux/powerpc64/rt_sigframe.h   \
720         linux/powerpc64/set_error.c     \
721         linux/powerpc64/set_scno.c      \
722         linux/powerpc64/syscallent.h    \
723         linux/powerpc64/syscallent1.h   \
724         linux/powerpc64/userent.h       \
725         linux/powerpc64le/arch_defs_.h  \
726         linux/powerpc64le/arch_regs.c   \
727         linux/powerpc64le/arch_rt_sigframe.c    \
728         linux/powerpc64le/errnoent.h    \
729         linux/powerpc64le/get_error.c   \
730         linux/powerpc64le/get_scno.c    \
731         linux/powerpc64le/get_syscall_args.c    \
732         linux/powerpc64le/ioctls_arch0.h        \
733         linux/powerpc64le/ioctls_inc0.h \
734         linux/powerpc64le/raw_syscall.h \
735         linux/powerpc64le/rt_sigframe.h \
736         linux/powerpc64le/set_error.c   \
737         linux/powerpc64le/set_scno.c    \
738         linux/powerpc64le/syscallent.h  \
739         linux/powerpc64le/userent.h     \
740         linux/ptrace_pokeuser.c         \
741         linux/raw_syscall.h             \
742         linux/riscv/arch_defs_.h        \
743         linux/riscv/arch_get_personality.c \
744         linux/riscv/arch_regs.c         \
745         linux/riscv/get_error.c         \
746         linux/riscv/get_scno.c          \
747         linux/riscv/get_syscall_args.c  \
748         linux/riscv/ioctls_arch0.h      \
749         linux/riscv/ioctls_arch1.h      \
750         linux/riscv/ioctls_inc0.h       \
751         linux/riscv/ioctls_inc1.h       \
752         linux/riscv/raw_syscall.h       \
753         linux/riscv/set_error.c         \
754         linux/riscv/set_scno.c          \
755         linux/riscv/syscallent.h        \
756         linux/riscv/syscallent1.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