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