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