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