]> granicus.if.org Git - strace/blob - Makefile.am
scsi: implement decoding of all SG_* ioctl commands
[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         rtc.c           \
213         sched.c         \
214         scsi.c          \
215         seccomp.c       \
216         seccomp_fprog.h \
217         sendfile.c      \
218         sg_io_v3.c      \
219         sg_io_v4.c      \
220         sigaltstack.c   \
221         sigevent.h      \
222         signal.c        \
223         signalfd.c      \
224         sigreturn.c     \
225         sock.c          \
226         sockaddr.c      \
227         socketutils.c   \
228         sram_alloc.c    \
229         stat.c          \
230         stat.h          \
231         stat64.c        \
232         statfs.c        \
233         statfs.h        \
234         strace.c        \
235         swapon.c        \
236         syscall.c       \
237         sysctl.c        \
238         sysent.h        \
239         sysinfo.c       \
240         syslog.c        \
241         sysmips.c       \
242         term.c          \
243         time.c          \
244         times.c         \
245         truncate.c      \
246         ubi.c           \
247         uid.c           \
248         uid16.c         \
249         umask.c         \
250         umount.c        \
251         uname.c         \
252         userfaultfd.c   \
253         util.c          \
254         utime.c         \
255         utimes.c        \
256         v4l2.c          \
257         wait.c          \
258         xattr.c         \
259         xlat.h          \
260         xmalloc.c       \
261         # end of strace_SOURCES
262
263 if USE_LIBUNWIND
264 strace_SOURCES += unwind.c
265 strace_CPPFLAGS += $(libunwind_CPPFLAGS)
266 strace_LDFLAGS += $(libunwind_LDFLAGS)
267 strace_LDADD += $(libunwind_LIBS)
268 endif
269
270 @CODE_COVERAGE_RULES@
271 CODE_COVERAGE_BRANCH_COVERAGE = 1
272 CODE_COVERAGE_GENHTML_OPTIONS = $(CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT) \
273         --prefix $(shell cd $(abs_top_srcdir)/.. && pwd || echo .)
274 CODE_COVERAGE_IGNORE_PATTERN = '/usr/include/*'
275 strace_CPPFLAGS += $(CODE_COVERAGE_CPPFLAGS)
276 strace_CFLAGS += $(CODE_COVERAGE_CFLAGS)
277 strace_LDADD += $(CODE_COVERAGE_LDFLAGS)
278
279 # Enable this to get link map generated
280 #strace_LDFLAGS += -Wl,-Map=strace.mapfile
281
282 EXTRA_DIST =                            \
283         $(man_MANS)                     \
284         .version                        \
285         COPYING                         \
286         CREDITS                         \
287         ChangeLog                       \
288         ChangeLog-CVS                   \
289         README-linux-ptrace             \
290         debian/changelog                \
291         debian/compat                   \
292         debian/control                  \
293         debian/copyright                \
294         debian/rules                    \
295         debian/source/format            \
296         debian/strace-udeb.install      \
297         debian/strace.docs              \
298         debian/strace.examples          \
299         debian/strace.install           \
300         debian/strace.manpages          \
301         debian/strace64.install         \
302         debian/strace64.manpages        \
303         debian/watch                    \
304         errnoent.sh                     \
305         generate_sen.sh                 \
306         ioctlsort.c                     \
307         linux/32/ioctls_inc.h           \
308         linux/32/ioctls_inc_align16.h   \
309         linux/32/ioctls_inc_align32.h   \
310         linux/32/ioctls_inc_align64.h   \
311         linux/32/syscallent.h           \
312         linux/64/ioctls_inc.h           \
313         linux/64/syscallent.h           \
314         linux/aarch64/arch_regs.c       \
315         linux/aarch64/arch_regs.h       \
316         linux/aarch64/arch_sigreturn.c  \
317         linux/aarch64/errnoent1.h       \
318         linux/aarch64/get_error.c       \
319         linux/aarch64/get_scno.c        \
320         linux/aarch64/get_syscall_args.c\
321         linux/aarch64/ioctls_arch0.h    \
322         linux/aarch64/ioctls_arch1.h    \
323         linux/aarch64/ioctls_inc0.h     \
324         linux/aarch64/ioctls_inc1.h     \
325         linux/aarch64/set_error.c       \
326         linux/aarch64/set_scno.c        \
327         linux/aarch64/signalent1.h      \
328         linux/aarch64/syscallent.h      \
329         linux/aarch64/syscallent1.h     \
330         linux/alpha/arch_getrval2.c     \
331         linux/alpha/arch_regs.c         \
332         linux/alpha/arch_regs.h         \
333         linux/alpha/arch_sigreturn.c    \
334         linux/alpha/errnoent.h          \
335         linux/alpha/get_error.c         \
336         linux/alpha/get_scno.c          \
337         linux/alpha/get_syscall_args.c  \
338         linux/alpha/get_syscall_result.c\
339         linux/alpha/ioctls_arch0.h      \
340         linux/alpha/ioctls_inc0.h       \
341         linux/alpha/set_error.c         \
342         linux/alpha/set_scno.c          \
343         linux/alpha/signalent.h         \
344         linux/alpha/syscallent.h        \
345         linux/alpha/userent.h           \
346         linux/arc/arch_regs.c           \
347         linux/arc/get_error.c           \
348         linux/arc/get_scno.c            \
349         linux/arc/get_syscall_args.c    \
350         linux/arc/ioctls_arch0.h        \
351         linux/arc/ioctls_inc0.h         \
352         linux/arc/set_error.c           \
353         linux/arc/set_scno.c            \
354         linux/arc/syscallent.h          \
355         linux/arch_regs.h               \
356         linux/arch_sigreturn.c          \
357         linux/arm/arch_regs.c           \
358         linux/arm/arch_regs.h           \
359         linux/arm/arch_sigreturn.c      \
360         linux/arm/get_error.c           \
361         linux/arm/get_scno.c            \
362         linux/arm/get_syscall_args.c    \
363         linux/arm/ioctls_arch0.h        \
364         linux/arm/ioctls_inc0.h         \
365         linux/arm/set_error.c           \
366         linux/arm/set_scno.c            \
367         linux/arm/syscallent.h          \
368         linux/arm/userent.h             \
369         linux/avr32/arch_regs.c         \
370         linux/avr32/get_error.c         \
371         linux/avr32/get_scno.c          \
372         linux/avr32/get_syscall_args.c  \
373         linux/avr32/ioctls_arch0.h      \
374         linux/avr32/ioctls_inc0.h       \
375         linux/avr32/set_error.c         \
376         linux/avr32/set_scno.c          \
377         linux/avr32/syscallent.h        \
378         linux/avr32/userent.h           \
379         linux/bfin/arch_regs.c          \
380         linux/bfin/get_error.c          \
381         linux/bfin/get_scno.c           \
382         linux/bfin/get_syscall_args.c   \
383         linux/bfin/get_syscall_result.c \
384         linux/bfin/ioctls_arch0.h       \
385         linux/bfin/ioctls_inc0.h        \
386         linux/bfin/set_error.c          \
387         linux/bfin/set_scno.c           \
388         linux/bfin/syscallent.h         \
389         linux/bfin/userent.h            \
390         linux/crisv10/arch_regs.c       \
391         linux/crisv10/arch_sigreturn.c  \
392         linux/crisv10/get_error.c       \
393         linux/crisv10/get_scno.c        \
394         linux/crisv10/get_syscall_args.c        \
395         linux/crisv10/get_syscall_result.c      \
396         linux/crisv10/set_error.c       \
397         linux/crisv10/set_scno.c        \
398         linux/crisv10/syscallent.h      \
399         linux/crisv10/userent.h         \
400         linux/crisv32/arch_regs.c       \
401         linux/crisv32/arch_sigreturn.c  \
402         linux/crisv32/get_error.c       \
403         linux/crisv32/get_scno.c        \
404         linux/crisv32/get_syscall_args.c        \
405         linux/crisv32/get_syscall_result.c      \
406         linux/crisv32/set_error.c       \
407         linux/crisv32/set_scno.c        \
408         linux/crisv32/syscallent.h      \
409         linux/crisv32/userent.h         \
410         linux/dummy.h                   \
411         linux/errnoent.h                \
412         linux/getregs_old.h             \
413         linux/hppa/arch_regs.c          \
414         linux/hppa/arch_regs.h          \
415         linux/hppa/errnoent.h           \
416         linux/hppa/get_error.c          \
417         linux/hppa/get_scno.c           \
418         linux/hppa/get_syscall_args.c   \
419         linux/hppa/get_syscall_result.c \
420         linux/hppa/ioctls_arch0.h       \
421         linux/hppa/ioctls_inc0.h        \
422         linux/hppa/set_error.c          \
423         linux/hppa/set_scno.c           \
424         linux/hppa/signalent.h          \
425         linux/hppa/syscallent.h         \
426         linux/i386/arch_regs.c          \
427         linux/i386/arch_regs.h          \
428         linux/i386/arch_sigreturn.c     \
429         linux/i386/get_error.c          \
430         linux/i386/get_scno.c           \
431         linux/i386/get_syscall_args.c   \
432         linux/i386/ioctls_arch0.h       \
433         linux/i386/ioctls_inc0.h        \
434         linux/i386/set_error.c          \
435         linux/i386/set_scno.c           \
436         linux/i386/syscallent.h         \
437         linux/i386/userent.h            \
438         linux/i386/userent0.h           \
439         linux/ia64/arch_getrval2.c      \
440         linux/ia64/arch_regs.c          \
441         linux/ia64/arch_regs.h          \
442         linux/ia64/arch_sigreturn.c     \
443         linux/ia64/get_error.c          \
444         linux/ia64/get_scno.c           \
445         linux/ia64/get_syscall_args.c   \
446         linux/ia64/ioctls_arch0.h       \
447         linux/ia64/ioctls_inc0.h        \
448         linux/ia64/set_error.c          \
449         linux/ia64/set_scno.c           \
450         linux/ia64/syscallent.h         \
451         linux/ia64/userent.h            \
452         linux/inet_diag.h               \
453         linux/m68k/arch_regs.c          \
454         linux/m68k/arch_regs.h          \
455         linux/m68k/arch_sigreturn.c     \
456         linux/m68k/get_error.c          \
457         linux/m68k/get_scno.c           \
458         linux/m68k/get_syscall_args.c   \
459         linux/m68k/ioctls_arch0.h       \
460         linux/m68k/ioctls_inc0.h        \
461         linux/m68k/set_error.c          \
462         linux/m68k/set_scno.c           \
463         linux/m68k/syscallent.h         \
464         linux/m68k/userent.h            \
465         linux/metag/arch_regs.c         \
466         linux/metag/get_error.c         \
467         linux/metag/get_scno.c          \
468         linux/metag/get_syscall_args.c  \
469         linux/metag/ioctls_arch0.h      \
470         linux/metag/ioctls_inc0.h       \
471         linux/metag/set_error.c         \
472         linux/metag/set_scno.c          \
473         linux/metag/syscallent.h        \
474         linux/microblaze/arch_regs.c    \
475         linux/microblaze/arch_sigreturn.c       \
476         linux/microblaze/get_error.c    \
477         linux/microblaze/get_scno.c     \
478         linux/microblaze/get_syscall_args.c     \
479         linux/microblaze/get_syscall_result.c   \
480         linux/microblaze/ioctls_arch0.h \
481         linux/microblaze/ioctls_inc0.h  \
482         linux/microblaze/set_error.c    \
483         linux/microblaze/set_scno.c     \
484         linux/microblaze/syscallent.h   \
485         linux/microblaze/userent.h      \
486         linux/mips/arch_getrval2.c      \
487         linux/mips/arch_regs.c          \
488         linux/mips/arch_regs.h          \
489         linux/mips/arch_sigreturn.c     \
490         linux/mips/errnoent.h           \
491         linux/mips/genstub.sh           \
492         linux/mips/get_error.c          \
493         linux/mips/get_scno.c           \
494         linux/mips/get_syscall_args.c   \
495         linux/mips/ioctls_arch0.h       \
496         linux/mips/ioctls_inc0.h        \
497         linux/mips/set_error.c          \
498         linux/mips/set_scno.c           \
499         linux/mips/signalent.h          \
500         linux/mips/syscallent-compat.h  \
501         linux/mips/syscallent-n32.h     \
502         linux/mips/syscallent-n64.h     \
503         linux/mips/syscallent-o32.h     \
504         linux/mips/syscallent.h         \
505         linux/mips/userent.h            \
506         linux/mtd-abi.h                 \
507         linux/netlink_diag.h            \
508         linux/nios2/arch_regs.c         \
509         linux/nios2/get_error.c         \
510         linux/nios2/get_scno.c          \
511         linux/nios2/get_syscall_args.c  \
512         linux/nios2/ioctls_arch0.h      \
513         linux/nios2/ioctls_inc0.h       \
514         linux/nios2/set_error.c         \
515         linux/nios2/set_scno.c          \
516         linux/nios2/syscallent.h        \
517         linux/or1k/arch_regs.c          \
518         linux/or1k/get_error.c          \
519         linux/or1k/get_scno.c           \
520         linux/or1k/get_syscall_args.c   \
521         linux/or1k/ioctls_arch0.h       \
522         linux/or1k/ioctls_inc0.h        \
523         linux/or1k/set_error.c          \
524         linux/or1k/set_scno.c           \
525         linux/or1k/syscallent.h         \
526         linux/or1k/userent.h            \
527         linux/personality.h             \
528         linux/powerpc/arch_regs.c       \
529         linux/powerpc/arch_regs.h       \
530         linux/powerpc/arch_sigreturn.c  \
531         linux/powerpc/errnoent.h        \
532         linux/powerpc/get_error.c       \
533         linux/powerpc/get_scno.c        \
534         linux/powerpc/get_syscall_args.c        \
535         linux/powerpc/getregs_old.c     \
536         linux/powerpc/getregs_old.h     \
537         linux/powerpc/ioctls_arch0.h    \
538         linux/powerpc/ioctls_inc0.h     \
539         linux/powerpc/set_error.c       \
540         linux/powerpc/set_scno.c        \
541         linux/powerpc/syscallent.h      \
542         linux/powerpc/userent.h         \
543         linux/powerpc64/arch_regs.c     \
544         linux/powerpc64/arch_regs.h     \
545         linux/powerpc64/arch_sigreturn.c        \
546         linux/powerpc64/errnoent.h      \
547         linux/powerpc64/errnoent1.h     \
548         linux/powerpc64/get_error.c     \
549         linux/powerpc64/get_scno.c      \
550         linux/powerpc64/get_syscall_args.c      \
551         linux/powerpc64/getregs_old.c   \
552         linux/powerpc64/getregs_old.h   \
553         linux/powerpc64/ioctls_arch0.h  \
554         linux/powerpc64/ioctls_arch1.h  \
555         linux/powerpc64/ioctls_inc0.h   \
556         linux/powerpc64/ioctls_inc1.h   \
557         linux/powerpc64/set_error.c     \
558         linux/powerpc64/set_scno.c      \
559         linux/powerpc64/signalent1.h    \
560         linux/powerpc64/syscallent.h    \
561         linux/powerpc64/syscallent1.h   \
562         linux/powerpc64/userent.h       \
563         linux/ptp_clock.h               \
564         linux/riscv/arch_regs.c         \
565         linux/riscv/errnoent1.h         \
566         linux/riscv/get_error.c         \
567         linux/riscv/get_scno.c          \
568         linux/riscv/get_syscall_args.c  \
569         linux/riscv/ioctls_arch0.h      \
570         linux/riscv/ioctls_arch1.h      \
571         linux/riscv/ioctls_inc0.h       \
572         linux/riscv/ioctls_inc1.h       \
573         linux/riscv/set_error.c         \
574         linux/riscv/set_scno.c          \
575         linux/riscv/signalent1.h        \
576         linux/riscv/syscallent.h        \
577         linux/riscv/syscallent1.h       \
578         linux/s390/arch_regs.c          \
579         linux/s390/arch_regs.h          \
580         linux/s390/arch_sigreturn.c     \
581         linux/s390/get_error.c          \
582         linux/s390/get_scno.c           \
583         linux/s390/get_syscall_args.c   \
584         linux/s390/ioctls_arch0.h       \
585         linux/s390/ioctls_inc0.h        \
586         linux/s390/set_error.c          \
587         linux/s390/set_scno.c           \
588         linux/s390/syscallent.h         \
589         linux/s390/userent.h            \
590         linux/s390/userent0.h           \
591         linux/s390/userent1.h           \
592         linux/s390x/arch_regs.c         \
593         linux/s390x/arch_regs.h         \
594         linux/s390x/arch_sigreturn.c    \
595         linux/s390x/get_error.c         \
596         linux/s390x/get_scno.c          \
597         linux/s390x/get_syscall_args.c  \
598         linux/s390x/ioctls_arch0.h      \
599         linux/s390x/ioctls_inc0.h       \
600         linux/s390x/set_error.c         \
601         linux/s390x/set_scno.c          \
602         linux/s390x/syscallent.h        \
603         linux/s390x/userent.h           \
604         linux/sh/arch_getrval2.c        \
605         linux/sh/arch_regs.c            \
606         linux/sh/get_error.c            \
607         linux/sh/get_scno.c             \
608         linux/sh/get_syscall_args.c     \
609         linux/sh/get_syscall_result.c   \
610         linux/sh/ioctls_arch0.h         \
611         linux/sh/ioctls_inc0.h          \
612         linux/sh/set_error.c            \
613         linux/sh/set_scno.c             \
614         linux/sh/syscallent.h           \
615         linux/sh/userent.h              \
616         linux/sh/userent0.h             \
617         linux/sh64/arch_regs.c          \
618         linux/sh64/arch_regs.h          \
619         linux/sh64/get_error.c          \
620         linux/sh64/get_scno.c           \
621         linux/sh64/get_syscall_args.c   \
622         linux/sh64/get_syscall_result.c \
623         linux/sh64/ioctls_arch0.h       \
624         linux/sh64/ioctls_inc0.h        \
625         linux/sh64/set_error.c          \
626         linux/sh64/set_scno.c           \
627         linux/sh64/syscallent.h         \
628         linux/sh64/userent.h            \
629         linux/signalent.h               \
630         linux/sock_diag.h               \
631         linux/sparc/arch_getrval2.c     \
632         linux/sparc/arch_regs.c         \
633         linux/sparc/arch_regs.h         \
634         linux/sparc/arch_sigreturn.c    \
635         linux/sparc/errnoent.h          \
636         linux/sparc/gen.pl              \
637         linux/sparc/get_error.c         \
638         linux/sparc/get_scno.c          \
639         linux/sparc/get_syscall_args.c  \
640         linux/sparc/ioctls_arch0.h      \
641         linux/sparc/ioctls_inc0.h       \
642         linux/sparc/set_error.c         \
643         linux/sparc/set_scno.c          \
644         linux/sparc/signalent.h         \
645         linux/sparc/syscallent.h        \
646         linux/sparc/userent.h           \
647         linux/sparc64/arch_getrval2.c   \
648         linux/sparc64/arch_regs.c       \
649         linux/sparc64/arch_regs.h       \
650         linux/sparc64/arch_sigreturn.c  \
651         linux/sparc64/errnoent.h        \
652         linux/sparc64/errnoent1.h       \
653         linux/sparc64/get_error.c       \
654         linux/sparc64/get_scno.c        \
655         linux/sparc64/get_syscall_args.c\
656         linux/sparc64/ioctls_arch0.h    \
657         linux/sparc64/ioctls_arch1.h    \
658         linux/sparc64/ioctls_inc0.h     \
659         linux/sparc64/ioctls_inc1.h     \
660         linux/sparc64/set_error.c       \
661         linux/sparc64/set_scno.c        \
662         linux/sparc64/signalent.h       \
663         linux/sparc64/signalent1.h      \
664         linux/sparc64/syscallent.h      \
665         linux/sparc64/syscallent1.h     \
666         linux/sparc64/userent.h         \
667         linux/subcall.h                 \
668         linux/syscall.h                 \
669         linux/tile/arch_regs.c          \
670         linux/tile/arch_regs.h          \
671         linux/tile/arch_sigreturn.c     \
672         linux/tile/errnoent1.h          \
673         linux/tile/get_error.c          \
674         linux/tile/get_scno.c           \
675         linux/tile/get_syscall_args.c   \
676         linux/tile/ioctls_arch0.h       \
677         linux/tile/ioctls_arch1.h       \
678         linux/tile/ioctls_inc0.h        \
679         linux/tile/ioctls_inc1.h        \
680         linux/tile/set_error.c          \
681         linux/tile/set_scno.c           \
682         linux/tile/signalent1.h         \
683         linux/tile/syscallent.h         \
684         linux/tile/syscallent1.h        \
685         linux/tile/userent.h            \
686         linux/ubi-user.h                \
687         linux/unix_diag.h               \
688         linux/userent.h                 \
689         linux/userent0.h                \
690         linux/x32/arch_regs.c           \
691         linux/x32/arch_regs.h           \
692         linux/x32/arch_sigreturn.c      \
693         linux/x32/errnoent1.h           \
694         linux/x32/get_error.c           \
695         linux/x32/get_scno.c            \
696         linux/x32/get_syscall_args.c    \
697         linux/x32/ioctls_arch0.h        \
698         linux/x32/ioctls_arch1.h        \
699         linux/x32/ioctls_inc0.h         \
700         linux/x32/ioctls_inc1.h         \
701         linux/x32/set_error.c           \
702         linux/x32/set_scno.c            \
703         linux/x32/signalent1.h          \
704         linux/x32/syscallent.h          \
705         linux/x32/syscallent1.h         \
706         linux/x32/userent.h             \
707         linux/x86_64/arch_regs.c        \
708         linux/x86_64/arch_regs.h        \
709         linux/x86_64/arch_sigreturn.c   \
710         linux/x86_64/errnoent1.h        \
711         linux/x86_64/errnoent2.h        \
712         linux/x86_64/gentab.pl          \
713         linux/x86_64/get_error.c        \
714         linux/x86_64/get_scno.c         \
715         linux/x86_64/get_syscall_args.c \
716         linux/x86_64/getregs_old.c      \
717         linux/x86_64/getregs_old.h      \
718         linux/x86_64/ioctls_arch0.h     \
719         linux/x86_64/ioctls_arch1.h     \
720         linux/x86_64/ioctls_arch2.h     \
721         linux/x86_64/ioctls_inc0.h      \
722         linux/x86_64/ioctls_inc1.h      \
723         linux/x86_64/ioctls_inc2.h      \
724         linux/x86_64/set_error.c        \
725         linux/x86_64/set_scno.c         \
726         linux/x86_64/signalent1.h       \
727         linux/x86_64/signalent2.h       \
728         linux/x86_64/syscallent.h       \
729         linux/x86_64/syscallent1.h      \
730         linux/x86_64/syscallent2.h      \
731         linux/x86_64/userent.h          \
732         linux/xtensa/arch_regs.c        \
733         linux/xtensa/get_error.c        \
734         linux/xtensa/get_scno.c         \
735         linux/xtensa/get_syscall_args.c \
736         linux/xtensa/get_syscall_result.c       \
737         linux/xtensa/ioctls_arch0.h     \
738         linux/xtensa/ioctls_inc0.h      \
739         linux/xtensa/set_error.c        \
740         linux/xtensa/set_scno.c         \
741         linux/xtensa/syscallent.h       \
742         linux/xtensa/userent.h          \
743         maint/ioctls_gen.sh             \
744         maint/ioctls_hex.sh             \
745         maint/ioctls_sym.sh             \
746         maint/print_ioctlent.c          \
747         mpers.awk                       \
748         mpers.sh                        \
749         mpers_test.sh                   \
750         mpers_xlat.h                    \
751         scno.head                       \
752         signalent.sh                    \
753         strace-graph                    \
754         strace-log-merge                \
755         strace.spec                     \
756         syscallent.sh                   \
757         $(XLAT_INPUT_FILES)             \
758         $(XLAT_HEADER_FILES)            \
759         xlat/gen.sh                     \
760         xlate.el
761
762 .PHONY: check-valgrind-local
763 check-valgrind-local:
764
765 .PHONY: srpm
766 srpm: dist-xz
767         rpmbuild --define '%_srcrpmdir .' -ts $(distdir).tar.xz
768
769 $(srcdir)/.version:
770         $(AM_V_GEN)echo $(VERSION) > $@-t && mv $@-t $@
771
772 strace_SOURCES_c = \
773         $(filter %.c,$(strace_SOURCES)) $(filter %.c,$(libstrace_a_SOURCES))
774
775 sys_func.h: $(patsubst %,$(srcdir)/%,$(strace_SOURCES_c))
776         for f in $^; do \
777                 sed -n 's/^SYS_FUNC(.*/extern &;/p' $$f; \
778         done | sort -u > $@
779
780 syscallent_names = subcall.h syscallent.h syscallent1.h \
781                    syscallent-n32.h syscallent-n64.h syscallent-o32.h
782 syscallent_patterns = $(patsubst %,\%/%,$(syscallent_names))
783 syscallent_files = $(filter $(syscallent_patterns),$(EXTRA_DIST))
784
785 sen.h: $(patsubst %,$(srcdir)/%,$(syscallent_files))
786         for f in $^; do cat -- $$f; done | \
787                 $(srcdir)/generate_sen.sh > $@
788
789 dist-hook:
790         $(AM_V_GEN)echo $(VERSION) > $(distdir)/.tarball-version
791
792 today = $(shell date +%Y-%m-%d)
793 version_regexp = $(subst .,\.,$(VERSION))
794 news_check_regexp = 'Noteworthy changes in release $(version_regexp) ($(today))'
795
796 news-check: NEWS
797         $(AM_V_GEN)if head -1 $< |                              \
798           grep -x $(news_check_regexp) >/dev/null; then         \
799                 :;                                              \
800         else                                                    \
801                 echo >&2 '$<: check failed';                    \
802                 exit 1;                                         \
803         fi
804
805 ioctlsort_CC = $(CC_FOR_BUILD)
806 ioctlsort_DEFS = $(DEFS)
807 ioctlsort_INCLUDES = $(DEFAULT_INCLUDES) $(INCLUDES)
808 ioctlsort_CPPFLAGS = $(AM_CPPFLAGS_FOR_BUILD) $(CPPFLAGS_FOR_BUILD)
809 ioctlsort_CFLAGS = $(AM_CFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD)
810 ioctlsort_LDFLAGS = $(AM_LDFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD)
811
812 ioctls_inc_h = $(wildcard $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h)
813 ioctlent_h = $(patsubst $(srcdir)/$(OS)/$(ARCH)/ioctls_inc%,ioctlent%,$(ioctls_inc_h))
814 ioctl_redefs_h = $(filter-out ioctl_redefs0.h,$(subst ioctlent,ioctl_redefs,$(ioctlent_h)))
815
816 ioctl_redefs%.h: ioctlent%.h ioctlent0.h
817         sort $< > $<-t
818         sort ioctlent0.h | comm -23 $<-t - | \
819                 sed -r -n 's/^\{ "([^"]+)", (0x[[:xdigit:]]+) \},$$/#ifdef \1\n# undef \1\n# define \1 \2\n#endif/p' \
820                 > $@-t
821         rm -f $<-t
822         mv $@-t $@
823
824 ioctlent%.h: ioctlsort%
825         ./$< > $@
826
827 ioctlsort%$(BUILD_EXEEXT): ioctlsort%.o
828         $(ioctlsort_CC) $(ioctlsort_CFLAGS) $(ioctlsort_LDFLAGS) $< -o $@
829
830 ioctlsort%.o: ioctls_all%.h $(srcdir)/ioctlsort.c
831         $(ioctlsort_CC) $(ioctlsort_DEFS) $(ioctlsort_INCLUDES) $(ioctlsort_CPPFLAGS) $(ioctlsort_CFLAGS) -DIOCTLSORT_INC=\"$<\" -c -o $@ $(srcdir)/ioctlsort.c
832
833 ioctls_all%.h: $(srcdir)/$(OS)/$(ARCH)/ioctls_inc%.h $(srcdir)/$(OS)/$(ARCH)/ioctls_arch%.h
834         cat $^ > $@
835
836 BUILT_SOURCES = $(ioctl_redefs_h) $(ioctlent_h) \
837                 native_printer_decls.h native_printer_defs.h printers.h sen.h sys_func.h .version
838 CLEANFILES    = $(ioctl_redefs_h) $(ioctlent_h) $(mpers_preproc_files) \
839                 native_printer_decls.h native_printer_defs.h printers.h sen.h sys_func.h
840 DISTCLEANFILES = gnu/stubs-32.h gnu/stubs-x32.h
841
842 include scno.am
843
844 $(strace_OBJECTS): scno.h
845
846 # defines mpers_source_files
847 include mpers.am
848 srcdir_mpers_source_files = $(patsubst %,$(srcdir)/%,$(mpers_source_files))
849 mpers_preproc_files = $(mpers_source_files:.c=.c.mpers.i)
850
851 mpers_NAME =
852 mpers_PREFIX = $(mpers_NAME)_
853 mpers_DEFS = $(DEFS)
854 mpers_INCLUDES = $(DEFAULT_INCLUDES) $(INCLUDES)
855 mpers_CPPFLAGS = $(strace_CPPFLAGS) $(CPPFLAGS)
856 mpers_sh_opts = $(mpers_DEFS) $(mpers_INCLUDES) $(mpers_CPPFLAGS)
857 libmpers_CPPFLAGS = $(strace_CPPFLAGS) -DIN_MPERS
858 libmpers_CFLAGS = $(strace_CFLAGS)
859
860 # mpers targets
861
862 mpers-m%.stamp: $(srcdir_mpers_source_files) | printers.h
863         for f in $^; do \
864                 CC="$(CC)" CFLAGS="$(mpers_sh_opts) -DMPERS_IS_$(mpers_NAME)" \
865                 CPP="$(CPP)" CPPFLAGS="$(mpers_sh_opts) -DIN_MPERS -DMPERS_IS_$(mpers_NAME)" \
866                 $(srcdir)/mpers.sh -$(mpers_NAME) $$f || exit; \
867         done
868         > $@
869
870 m%_type_defs.h: $(srcdir_mpers_source_files)
871         for f in $^; do \
872                 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; \
873         done > $@-t
874         echo '#undef MPERS_PRINTER_NAME' >> $@-t
875         echo '#define MPERS_PRINTER_NAME(printer_name) printer_name' >> $@-t
876         echo '#include "$(mpers_PREFIX)printer_decls.h"' >> $@-t
877         echo '#include MPERS_$(mpers_PREFIX)IOCTL_MACROS' >> $@-t
878         mv $@-t $@
879
880 m%_funcs.h: $(srcdir_mpers_source_files)
881         for f in $^; do \
882                 sed -r -n 's/^SYS_FUNC\(([^)]+)\)/#undef sys_\1\n#define sys_\1 $(mpers_PREFIX)sys_\1/p' $$f || exit; \
883         done > $@-t && \
884         echo '#include "sys_func.h"' >> $@-t
885         mv $@-t $@
886
887 # printers
888
889 %.c.mpers.i: $(srcdir)/%.c
890         $(CPP) -P $(mpers_sh_opts) -DIN_MPERS_BOOTSTRAP $< -o $@
891
892 mpers_printer_decl_pattern = ^MPERS_PRINTER_DECL\(([^,)]+),[[:space:]]*([^,)]+),[[:space:]]*([^)]+)\)$$
893
894 printers.h: $(mpers_preproc_files)
895         echo '/* Generated by Makefile from $^; do not edit. */' > $@-t
896         echo 'typedef struct {' >> $@-t
897         for f in $^; do \
898                 sed -r -n 's/$(mpers_printer_decl_pattern)/ \1 (*\2)(\3);\n#define \2 MPERS_PRINTER_NAME(\2)\n/p' $$f \
899                 || exit; \
900         done >> $@-t
901         echo '} struct_printers;' >> $@-t
902         echo 'extern const struct_printers *printers;' >> $@-t
903         echo '#define MPERS_PRINTER_NAME(printer_name) printers->printer_name' >> $@-t
904         mv $@-t $@
905
906 %_printer_decls.h: $(mpers_preproc_files)
907         echo '/* Generated by Makefile from $^; do not edit. */' > $@-t
908         for f in $^; do \
909                 sed -r -n 's/$(mpers_printer_decl_pattern)/extern \1 $(mpers_PREFIX)\2(\3);/p' $$f \
910                 || exit; \
911         done >> $@-t
912         mv $@-t $@
913
914 %_printer_defs.h: $(mpers_preproc_files)
915         echo '/* Generated by Makefile from $^; do not edit. */' > $@-t
916         for f in $^; do \
917                 sed -r -n 's/$(mpers_printer_decl_pattern)/.\2 = $(mpers_PREFIX)\2,/p' $$f \
918                 || exit; \
919         done >> $@-t
920         mv $@-t $@
921
922 native_printer_decls.h native_printer_defs.h: mpers_PREFIX =
923
924 if HAVE_M32_MPERS
925
926 strace_LDADD += libmpers-m32.a
927 noinst_LIBRARIES += libmpers-m32.a
928 libmpers_m32_a_SOURCES = $(mpers_source_files)
929 libmpers_m32_a_CPPFLAGS = $(libmpers_CPPFLAGS) -DMPERS_IS_m32 -I$(builddir)/mpers-m32
930 libmpers_m32_a_CFLAGS = $(libmpers_CFLAGS)
931 mpers_m32_targets = mpers-m32.stamp m32_type_defs.h m32_funcs.h m32_printer_decls.h m32_printer_defs.h
932
933 BUILT_SOURCES += $(mpers_m32_targets)
934 CLEANFILES    += $(mpers_m32_targets)
935
936 $(mpers_m32_targets): mpers_NAME = m32
937
938 endif # HAVE_M32_MPERS
939
940 if HAVE_MX32_MPERS
941
942 strace_LDADD += libmpers-mx32.a
943 noinst_LIBRARIES += libmpers-mx32.a
944 libmpers_mx32_a_SOURCES = $(mpers_source_files)
945 libmpers_mx32_a_CPPFLAGS = $(libmpers_CPPFLAGS) -DMPERS_IS_mx32 -I$(builddir)/mpers-mx32
946 libmpers_mx32_a_CFLAGS = $(libmpers_CFLAGS)
947 mpers_mx32_targets = mpers-mx32.stamp mx32_type_defs.h mx32_funcs.h mx32_printer_decls.h mx32_printer_defs.h
948
949 BUILT_SOURCES += $(mpers_mx32_targets)
950 CLEANFILES    += $(mpers_mx32_targets)
951
952 $(mpers_mx32_targets): mpers_NAME = mx32
953
954 endif # HAVE_MX32_MPERS
955
956 clean-local:
957         -rm -rf mpers-m32 mpers-mx32
958
959 if MAINTAINER_MODE
960
961 gen_changelog_start_date = 2009-07-08 20:00
962 $(srcdir)/ChangeLog: $(srcdir)/gitlog-to-changelog $(srcdir)/Makefile.in \
963                      $(srcdir)/.version
964         @rm -f $@.new
965         (cd $(srcdir); \
966          ./gitlog-to-changelog --append-dot \
967            --since='$(gen_changelog_start_date)'; \
968          echo; echo; echo 'See ChangeLog-CVS for older changes.' \
969         ) > $@.new
970         chmod 444 $@.new
971         mv -f $@.new $@
972
973 $(srcdir)/CREDITS: $(srcdir)/CREDITS.in $(srcdir)/.mailmap \
974                    $(srcdir)/Makefile.in $(srcdir)/.version
975         $(AM_V_GEN)                                                     \
976         (                                                               \
977           cd $(srcdir);                                                 \
978           sed '/^##/,$$d' CREDITS.in;                                   \
979           { sed -n '1,/^##>/d; s/   */\t/; s/^./&/p' CREDITS.in;        \
980             git log --pretty=format:'%aN        %aE';                   \
981           } | LC_ALL=C sort -u                                          \
982             | awk -F'\t' '{printf("\t%s <%s>\n",$$1,$$2)}';             \
983         ) > $@-t && mv $@-t $@
984
985 export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner --mode=go-w,go+rX
986
987 endif