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