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