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