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