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