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