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