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