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