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