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