1 # Automake input for strace.
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>
9 # Redistribution and use in source and binary forms, with or without
10 # modification, are permitted provided that the following conditions
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.
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.
35 TESTS_MX32 = tests-mx32
37 SUBDIRS = tests $(TESTS_M32) $(TESTS_MX32)
41 bin_SCRIPTS = strace-graph strace-log-merge
44 # ARCH is `i386', `m68k', `sparc', etc.
47 ACLOCAL_AMFLAGS = -I m4
48 AM_CFLAGS = $(WARN_CFLAGS)
49 AM_CPPFLAGS = -I$(builddir)/$(OS)/$(ARCH) \
50 -I$(srcdir)/$(OS)/$(ARCH) \
56 include xlat/Makemodule.am
58 strace_CPPFLAGS = $(AM_CPPFLAGS)
59 strace_CFLAGS = $(AM_CFLAGS)
61 strace_LDADD = libstrace.a
62 noinst_LIBRARIES = libstrace.a
64 libstrace_a_CPPFLAGS = $(strace_CPPFLAGS)
65 libstrace_a_CFLAGS = $(strace_CFLAGS)
66 libstrace_a_SOURCES = \
77 # end of libstrace_a_SOURCES
112 fetch_seccomp_fprog.c \
113 fetch_struct_flock.c \
114 fetch_struct_mmsghdr.c \
115 fetch_struct_msghdr.c \
116 fetch_struct_stat.c \
117 fetch_struct_stat64.c \
118 fetch_struct_statfs.c \
151 linux/x32/asm_stat.h \
152 linux/x86_64/asm_stat.h \
176 perf_event_struct.h \
185 print_struct_stat.c \
252 # end of strace_SOURCES
255 strace_SOURCES += unwind.c
256 strace_CPPFLAGS += $(libunwind_CPPFLAGS)
257 strace_LDFLAGS += $(libunwind_LDFLAGS)
258 strace_LDADD += $(libunwind_LIBS)
261 @CODE_COVERAGE_RULES@
262 CODE_COVERAGE_BRANCH_COVERAGE = 1
263 CODE_COVERAGE_GENHTML_OPTIONS = $(CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT) \
264 --prefix $(shell cd $(abs_top_srcdir)/.. && pwd || echo .)
265 CODE_COVERAGE_IGNORE_PATTERN = '/usr/include/*'
266 strace_CPPFLAGS += $(CODE_COVERAGE_CPPFLAGS)
267 strace_CFLAGS += $(CODE_COVERAGE_CFLAGS)
268 strace_LDADD += $(CODE_COVERAGE_LDFLAGS)
270 # Enable this to get link map generated
271 #strace_LDFLAGS += -Wl,-Map=strace.mapfile
280 README-linux-ptrace \
286 debian/source/format \
287 debian/strace-udeb.install \
289 debian/strace.examples \
290 debian/strace.install \
291 debian/strace.manpages \
292 debian/strace64.install \
293 debian/strace64.manpages \
298 linux/32/ioctls_inc.h \
299 linux/32/ioctls_inc_align16.h \
300 linux/32/ioctls_inc_align32.h \
301 linux/32/ioctls_inc_align64.h \
302 linux/32/syscallent.h \
303 linux/64/ioctls_inc.h \
304 linux/64/syscallent.h \
305 linux/aarch64/arch_regs.c \
306 linux/aarch64/arch_regs.h \
307 linux/aarch64/arch_sigreturn.c \
308 linux/aarch64/errnoent1.h \
309 linux/aarch64/get_error.c \
310 linux/aarch64/get_scno.c \
311 linux/aarch64/get_syscall_args.c\
312 linux/aarch64/ioctls_arch0.h \
313 linux/aarch64/ioctls_arch1.h \
314 linux/aarch64/ioctls_inc0.h \
315 linux/aarch64/ioctls_inc1.h \
316 linux/aarch64/set_error.c \
317 linux/aarch64/set_scno.c \
318 linux/aarch64/signalent1.h \
319 linux/aarch64/syscallent.h \
320 linux/aarch64/syscallent1.h \
321 linux/alpha/arch_getrval2.c \
322 linux/alpha/arch_regs.c \
323 linux/alpha/arch_regs.h \
324 linux/alpha/arch_sigreturn.c \
325 linux/alpha/errnoent.h \
326 linux/alpha/get_error.c \
327 linux/alpha/get_scno.c \
328 linux/alpha/get_syscall_args.c \
329 linux/alpha/get_syscall_result.c\
330 linux/alpha/ioctls_arch0.h \
331 linux/alpha/ioctls_inc0.h \
332 linux/alpha/set_error.c \
333 linux/alpha/set_scno.c \
334 linux/alpha/signalent.h \
335 linux/alpha/syscallent.h \
336 linux/alpha/userent.h \
337 linux/arc/arch_regs.c \
338 linux/arc/get_error.c \
339 linux/arc/get_scno.c \
340 linux/arc/get_syscall_args.c \
341 linux/arc/ioctls_arch0.h \
342 linux/arc/ioctls_inc0.h \
343 linux/arc/set_error.c \
344 linux/arc/set_scno.c \
345 linux/arc/syscallent.h \
347 linux/arch_sigreturn.c \
348 linux/arm/arch_regs.c \
349 linux/arm/arch_regs.h \
350 linux/arm/arch_sigreturn.c \
351 linux/arm/get_error.c \
352 linux/arm/get_scno.c \
353 linux/arm/get_syscall_args.c \
354 linux/arm/ioctls_arch0.h \
355 linux/arm/ioctls_inc0.h \
356 linux/arm/set_error.c \
357 linux/arm/set_scno.c \
358 linux/arm/syscallent.h \
359 linux/arm/userent.h \
360 linux/avr32/arch_regs.c \
361 linux/avr32/get_error.c \
362 linux/avr32/get_scno.c \
363 linux/avr32/get_syscall_args.c \
364 linux/avr32/ioctls_arch0.h \
365 linux/avr32/ioctls_inc0.h \
366 linux/avr32/set_error.c \
367 linux/avr32/set_scno.c \
368 linux/avr32/syscallent.h \
369 linux/avr32/userent.h \
370 linux/bfin/arch_regs.c \
371 linux/bfin/get_error.c \
372 linux/bfin/get_scno.c \
373 linux/bfin/get_syscall_args.c \
374 linux/bfin/get_syscall_result.c \
375 linux/bfin/ioctls_arch0.h \
376 linux/bfin/ioctls_inc0.h \
377 linux/bfin/set_error.c \
378 linux/bfin/set_scno.c \
379 linux/bfin/syscallent.h \
380 linux/bfin/userent.h \
381 linux/crisv10/arch_regs.c \
382 linux/crisv10/arch_sigreturn.c \
383 linux/crisv10/get_error.c \
384 linux/crisv10/get_scno.c \
385 linux/crisv10/get_syscall_args.c \
386 linux/crisv10/get_syscall_result.c \
387 linux/crisv10/set_error.c \
388 linux/crisv10/set_scno.c \
389 linux/crisv10/syscallent.h \
390 linux/crisv10/userent.h \
391 linux/crisv32/arch_regs.c \
392 linux/crisv32/arch_sigreturn.c \
393 linux/crisv32/get_error.c \
394 linux/crisv32/get_scno.c \
395 linux/crisv32/get_syscall_args.c \
396 linux/crisv32/get_syscall_result.c \
397 linux/crisv32/set_error.c \
398 linux/crisv32/set_scno.c \
399 linux/crisv32/syscallent.h \
400 linux/crisv32/userent.h \
403 linux/getregs_old.h \
404 linux/hppa/arch_regs.c \
405 linux/hppa/arch_regs.h \
406 linux/hppa/errnoent.h \
407 linux/hppa/get_error.c \
408 linux/hppa/get_scno.c \
409 linux/hppa/get_syscall_args.c \
410 linux/hppa/get_syscall_result.c \
411 linux/hppa/ioctls_arch0.h \
412 linux/hppa/ioctls_inc0.h \
413 linux/hppa/set_error.c \
414 linux/hppa/set_scno.c \
415 linux/hppa/signalent.h \
416 linux/hppa/syscallent.h \
417 linux/i386/arch_regs.c \
418 linux/i386/arch_regs.h \
419 linux/i386/arch_sigreturn.c \
420 linux/i386/get_error.c \
421 linux/i386/get_scno.c \
422 linux/i386/get_syscall_args.c \
423 linux/i386/ioctls_arch0.h \
424 linux/i386/ioctls_inc0.h \
425 linux/i386/set_error.c \
426 linux/i386/set_scno.c \
427 linux/i386/syscallent.h \
428 linux/i386/userent.h \
429 linux/i386/userent0.h \
430 linux/ia64/arch_getrval2.c \
431 linux/ia64/arch_regs.c \
432 linux/ia64/arch_regs.h \
433 linux/ia64/arch_sigreturn.c \
434 linux/ia64/get_error.c \
435 linux/ia64/get_scno.c \
436 linux/ia64/get_syscall_args.c \
437 linux/ia64/ioctls_arch0.h \
438 linux/ia64/ioctls_inc0.h \
439 linux/ia64/set_error.c \
440 linux/ia64/set_scno.c \
441 linux/ia64/syscallent.h \
442 linux/ia64/userent.h \
444 linux/m68k/arch_regs.c \
445 linux/m68k/arch_regs.h \
446 linux/m68k/arch_sigreturn.c \
447 linux/m68k/get_error.c \
448 linux/m68k/get_scno.c \
449 linux/m68k/get_syscall_args.c \
450 linux/m68k/ioctls_arch0.h \
451 linux/m68k/ioctls_inc0.h \
452 linux/m68k/set_error.c \
453 linux/m68k/set_scno.c \
454 linux/m68k/syscallent.h \
455 linux/m68k/userent.h \
456 linux/metag/arch_regs.c \
457 linux/metag/get_error.c \
458 linux/metag/get_scno.c \
459 linux/metag/get_syscall_args.c \
460 linux/metag/ioctls_arch0.h \
461 linux/metag/ioctls_inc0.h \
462 linux/metag/set_error.c \
463 linux/metag/set_scno.c \
464 linux/metag/syscallent.h \
465 linux/microblaze/arch_regs.c \
466 linux/microblaze/arch_sigreturn.c \
467 linux/microblaze/get_error.c \
468 linux/microblaze/get_scno.c \
469 linux/microblaze/get_syscall_args.c \
470 linux/microblaze/get_syscall_result.c \
471 linux/microblaze/ioctls_arch0.h \
472 linux/microblaze/ioctls_inc0.h \
473 linux/microblaze/set_error.c \
474 linux/microblaze/set_scno.c \
475 linux/microblaze/syscallent.h \
476 linux/microblaze/userent.h \
477 linux/mips/arch_getrval2.c \
478 linux/mips/arch_regs.c \
479 linux/mips/arch_regs.h \
480 linux/mips/arch_sigreturn.c \
481 linux/mips/errnoent.h \
482 linux/mips/genstub.sh \
483 linux/mips/get_error.c \
484 linux/mips/get_scno.c \
485 linux/mips/get_syscall_args.c \
486 linux/mips/ioctls_arch0.h \
487 linux/mips/ioctls_inc0.h \
488 linux/mips/set_error.c \
489 linux/mips/set_scno.c \
490 linux/mips/signalent.h \
491 linux/mips/syscallent-compat.h \
492 linux/mips/syscallent-n32.h \
493 linux/mips/syscallent-n64.h \
494 linux/mips/syscallent-o32.h \
495 linux/mips/syscallent.h \
496 linux/mips/userent.h \
498 linux/netlink_diag.h \
499 linux/nios2/arch_regs.c \
500 linux/nios2/get_error.c \
501 linux/nios2/get_scno.c \
502 linux/nios2/get_syscall_args.c \
503 linux/nios2/ioctls_arch0.h \
504 linux/nios2/ioctls_inc0.h \
505 linux/nios2/set_error.c \
506 linux/nios2/set_scno.c \
507 linux/nios2/syscallent.h \
508 linux/or1k/arch_regs.c \
509 linux/or1k/get_error.c \
510 linux/or1k/get_scno.c \
511 linux/or1k/get_syscall_args.c \
512 linux/or1k/ioctls_arch0.h \
513 linux/or1k/ioctls_inc0.h \
514 linux/or1k/set_error.c \
515 linux/or1k/set_scno.c \
516 linux/or1k/syscallent.h \
517 linux/or1k/userent.h \
518 linux/personality.h \
519 linux/powerpc/arch_regs.c \
520 linux/powerpc/arch_regs.h \
521 linux/powerpc/arch_sigreturn.c \
522 linux/powerpc/errnoent.h \
523 linux/powerpc/get_error.c \
524 linux/powerpc/get_scno.c \
525 linux/powerpc/get_syscall_args.c \
526 linux/powerpc/getregs_old.c \
527 linux/powerpc/getregs_old.h \
528 linux/powerpc/ioctls_arch0.h \
529 linux/powerpc/ioctls_inc0.h \
530 linux/powerpc/set_error.c \
531 linux/powerpc/set_scno.c \
532 linux/powerpc/syscallent.h \
533 linux/powerpc/userent.h \
534 linux/powerpc64/arch_regs.c \
535 linux/powerpc64/arch_regs.h \
536 linux/powerpc64/arch_sigreturn.c \
537 linux/powerpc64/errnoent.h \
538 linux/powerpc64/errnoent1.h \
539 linux/powerpc64/get_error.c \
540 linux/powerpc64/get_scno.c \
541 linux/powerpc64/get_syscall_args.c \
542 linux/powerpc64/getregs_old.c \
543 linux/powerpc64/getregs_old.h \
544 linux/powerpc64/ioctls_arch0.h \
545 linux/powerpc64/ioctls_arch1.h \
546 linux/powerpc64/ioctls_inc0.h \
547 linux/powerpc64/ioctls_inc1.h \
548 linux/powerpc64/set_error.c \
549 linux/powerpc64/set_scno.c \
550 linux/powerpc64/signalent1.h \
551 linux/powerpc64/syscallent.h \
552 linux/powerpc64/syscallent1.h \
553 linux/powerpc64/userent.h \
555 linux/riscv/arch_regs.c \
556 linux/riscv/errnoent1.h \
557 linux/riscv/get_error.c \
558 linux/riscv/get_scno.c \
559 linux/riscv/get_syscall_args.c \
560 linux/riscv/ioctls_arch0.h \
561 linux/riscv/ioctls_arch1.h \
562 linux/riscv/ioctls_inc0.h \
563 linux/riscv/ioctls_inc1.h \
564 linux/riscv/set_error.c \
565 linux/riscv/set_scno.c \
566 linux/riscv/signalent1.h \
567 linux/riscv/syscallent.h \
568 linux/riscv/syscallent1.h \
569 linux/s390/arch_regs.c \
570 linux/s390/arch_regs.h \
571 linux/s390/arch_sigreturn.c \
572 linux/s390/get_error.c \
573 linux/s390/get_scno.c \
574 linux/s390/get_syscall_args.c \
575 linux/s390/ioctls_arch0.h \
576 linux/s390/ioctls_inc0.h \
577 linux/s390/set_error.c \
578 linux/s390/set_scno.c \
579 linux/s390/syscallent.h \
580 linux/s390/userent.h \
581 linux/s390/userent0.h \
582 linux/s390/userent1.h \
583 linux/s390x/arch_regs.c \
584 linux/s390x/arch_regs.h \
585 linux/s390x/arch_sigreturn.c \
586 linux/s390x/get_error.c \
587 linux/s390x/get_scno.c \
588 linux/s390x/get_syscall_args.c \
589 linux/s390x/ioctls_arch0.h \
590 linux/s390x/ioctls_inc0.h \
591 linux/s390x/set_error.c \
592 linux/s390x/set_scno.c \
593 linux/s390x/syscallent.h \
594 linux/s390x/userent.h \
595 linux/sh/arch_getrval2.c \
596 linux/sh/arch_regs.c \
597 linux/sh/get_error.c \
598 linux/sh/get_scno.c \
599 linux/sh/get_syscall_args.c \
600 linux/sh/get_syscall_result.c \
601 linux/sh/ioctls_arch0.h \
602 linux/sh/ioctls_inc0.h \
603 linux/sh/set_error.c \
604 linux/sh/set_scno.c \
605 linux/sh/syscallent.h \
607 linux/sh/userent0.h \
608 linux/sh64/arch_regs.c \
609 linux/sh64/arch_regs.h \
610 linux/sh64/get_error.c \
611 linux/sh64/get_scno.c \
612 linux/sh64/get_syscall_args.c \
613 linux/sh64/get_syscall_result.c \
614 linux/sh64/ioctls_arch0.h \
615 linux/sh64/ioctls_inc0.h \
616 linux/sh64/set_error.c \
617 linux/sh64/set_scno.c \
618 linux/sh64/syscallent.h \
619 linux/sh64/userent.h \
622 linux/sparc/arch_getrval2.c \
623 linux/sparc/arch_regs.c \
624 linux/sparc/arch_regs.h \
625 linux/sparc/arch_sigreturn.c \
626 linux/sparc/errnoent.h \
628 linux/sparc/get_error.c \
629 linux/sparc/get_scno.c \
630 linux/sparc/get_syscall_args.c \
631 linux/sparc/ioctls_arch0.h \
632 linux/sparc/ioctls_inc0.h \
633 linux/sparc/set_error.c \
634 linux/sparc/set_scno.c \
635 linux/sparc/signalent.h \
636 linux/sparc/syscallent.h \
637 linux/sparc/userent.h \
638 linux/sparc64/arch_getrval2.c \
639 linux/sparc64/arch_regs.c \
640 linux/sparc64/arch_regs.h \
641 linux/sparc64/arch_sigreturn.c \
642 linux/sparc64/errnoent.h \
643 linux/sparc64/errnoent1.h \
644 linux/sparc64/get_error.c \
645 linux/sparc64/get_scno.c \
646 linux/sparc64/get_syscall_args.c\
647 linux/sparc64/ioctls_arch0.h \
648 linux/sparc64/ioctls_arch1.h \
649 linux/sparc64/ioctls_inc0.h \
650 linux/sparc64/ioctls_inc1.h \
651 linux/sparc64/set_error.c \
652 linux/sparc64/set_scno.c \
653 linux/sparc64/signalent.h \
654 linux/sparc64/signalent1.h \
655 linux/sparc64/syscallent.h \
656 linux/sparc64/syscallent1.h \
657 linux/sparc64/userent.h \
660 linux/tile/arch_regs.c \
661 linux/tile/arch_regs.h \
662 linux/tile/arch_sigreturn.c \
663 linux/tile/errnoent1.h \
664 linux/tile/get_error.c \
665 linux/tile/get_scno.c \
666 linux/tile/get_syscall_args.c \
667 linux/tile/ioctls_arch0.h \
668 linux/tile/ioctls_arch1.h \
669 linux/tile/ioctls_inc0.h \
670 linux/tile/ioctls_inc1.h \
671 linux/tile/set_error.c \
672 linux/tile/set_scno.c \
673 linux/tile/signalent1.h \
674 linux/tile/syscallent.h \
675 linux/tile/syscallent1.h \
676 linux/tile/userent.h \
681 linux/x32/arch_regs.c \
682 linux/x32/arch_regs.h \
683 linux/x32/arch_sigreturn.c \
684 linux/x32/errnoent1.h \
685 linux/x32/get_error.c \
686 linux/x32/get_scno.c \
687 linux/x32/get_syscall_args.c \
688 linux/x32/ioctls_arch0.h \
689 linux/x32/ioctls_arch1.h \
690 linux/x32/ioctls_inc0.h \
691 linux/x32/ioctls_inc1.h \
692 linux/x32/set_error.c \
693 linux/x32/set_scno.c \
694 linux/x32/signalent1.h \
695 linux/x32/syscallent.h \
696 linux/x32/syscallent1.h \
697 linux/x32/userent.h \
698 linux/x86_64/arch_regs.c \
699 linux/x86_64/arch_regs.h \
700 linux/x86_64/arch_sigreturn.c \
701 linux/x86_64/errnoent1.h \
702 linux/x86_64/errnoent2.h \
703 linux/x86_64/gentab.pl \
704 linux/x86_64/get_error.c \
705 linux/x86_64/get_scno.c \
706 linux/x86_64/get_syscall_args.c \
707 linux/x86_64/getregs_old.c \
708 linux/x86_64/getregs_old.h \
709 linux/x86_64/ioctls_arch0.h \
710 linux/x86_64/ioctls_arch1.h \
711 linux/x86_64/ioctls_arch2.h \
712 linux/x86_64/ioctls_inc0.h \
713 linux/x86_64/ioctls_inc1.h \
714 linux/x86_64/ioctls_inc2.h \
715 linux/x86_64/set_error.c \
716 linux/x86_64/set_scno.c \
717 linux/x86_64/signalent1.h \
718 linux/x86_64/signalent2.h \
719 linux/x86_64/syscallent.h \
720 linux/x86_64/syscallent1.h \
721 linux/x86_64/syscallent2.h \
722 linux/x86_64/userent.h \
723 linux/xtensa/arch_regs.c \
724 linux/xtensa/get_error.c \
725 linux/xtensa/get_scno.c \
726 linux/xtensa/get_syscall_args.c \
727 linux/xtensa/get_syscall_result.c \
728 linux/xtensa/ioctls_arch0.h \
729 linux/xtensa/ioctls_inc0.h \
730 linux/xtensa/set_error.c \
731 linux/xtensa/set_scno.c \
732 linux/xtensa/syscallent.h \
733 linux/xtensa/userent.h \
734 maint/ioctls_gen.sh \
735 maint/ioctls_hex.sh \
736 maint/ioctls_sym.sh \
737 maint/print_ioctlent.c \
747 $(XLAT_INPUT_FILES) \
748 $(XLAT_HEADER_FILES) \
754 rpmbuild --define '%_srcrpmdir .' -ts $(distdir).tar.xz
757 $(AM_V_GEN)echo $(VERSION) > $@-t && mv $@-t $@
760 $(filter %.c,$(strace_SOURCES)) $(filter %.c,$(libstrace_a_SOURCES))
762 sys_func.h: $(patsubst %,$(srcdir)/%,$(strace_SOURCES_c))
764 sed -n 's/^SYS_FUNC(.*/extern &;/p' $$f; \
767 syscallent_names = subcall.h syscallent.h syscallent1.h \
768 syscallent-n32.h syscallent-n64.h syscallent-o32.h
769 syscallent_patterns = $(patsubst %,\%/%,$(syscallent_names))
770 syscallent_files = $(filter $(syscallent_patterns),$(EXTRA_DIST))
772 sen.h: $(patsubst %,$(srcdir)/%,$(syscallent_files))
773 for f in $^; do cat -- $$f; done | \
774 $(srcdir)/generate_sen.sh > $@
777 $(AM_V_GEN)echo $(VERSION) > $(distdir)/.tarball-version
779 today = $(shell date +%Y-%m-%d)
780 version_regexp = $(subst .,\.,$(VERSION))
781 news_check_regexp = 'Noteworthy changes in release $(version_regexp) ($(today))'
784 $(AM_V_GEN)if head -1 $< | \
785 grep -x $(news_check_regexp) >/dev/null; then \
788 echo >&2 '$<: check failed'; \
792 ioctlsort_CC = $(CC_FOR_BUILD)
793 ioctlsort_DEFS = $(DEFS)
794 ioctlsort_INCLUDES = $(DEFAULT_INCLUDES) $(INCLUDES)
795 ioctlsort_CPPFLAGS = $(AM_CPPFLAGS) $(CPPFLAGS_FOR_BUILD)
796 ioctlsort_CFLAGS = $(AM_CFLAGS) $(CFLAGS_FOR_BUILD)
797 ioctlsort_LDFLAGS = $(AM_LDFLAGS) $(LDFLAGS_FOR_BUILD)
799 ioctls_inc_h = $(wildcard $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h)
800 ioctlent_h = $(patsubst $(srcdir)/$(OS)/$(ARCH)/ioctls_inc%,ioctlent%,$(ioctls_inc_h))
801 ioctl_redefs_h = $(filter-out ioctl_redefs0.h,$(subst ioctlent,ioctl_redefs,$(ioctlent_h)))
803 ioctl_redefs%.h: ioctlent%.h ioctlent0.h
805 sort ioctlent0.h | comm -23 $<-t - | \
806 sed -r -n 's/^\{ "([^"]+)", (0x[[:xdigit:]]+) \},$$/#ifdef \1\n# undef \1\n# define \1 \2\n#endif/p' \
811 ioctlent%.h: ioctlsort%
814 ioctlsort%$(BUILD_EXEEXT): ioctlsort%.o
815 $(ioctlsort_CC) $(ioctlsort_CFLAGS) $(ioctlsort_LDFLAGS) $< -o $@
817 ioctlsort%.o: ioctls_all%.h $(srcdir)/ioctlsort.c
818 $(ioctlsort_CC) $(ioctlsort_DEFS) $(ioctlsort_INCLUDES) $(ioctlsort_CPPFLAGS) $(ioctlsort_CFLAGS) -DIOCTLSORT_INC=\"$<\" -c -o $@ $(srcdir)/ioctlsort.c
820 ioctls_all%.h: $(srcdir)/$(OS)/$(ARCH)/ioctls_inc%.h $(srcdir)/$(OS)/$(ARCH)/ioctls_arch%.h
823 BUILT_SOURCES = $(ioctl_redefs_h) $(ioctlent_h) \
824 native_printer_decls.h native_printer_defs.h printers.h sen.h sys_func.h .version
825 CLEANFILES = $(ioctl_redefs_h) $(ioctlent_h) $(mpers_preproc_files) \
826 native_printer_decls.h native_printer_defs.h printers.h sen.h sys_func.h
827 DISTCLEANFILES = gnu/stubs-32.h gnu/stubs-x32.h
829 # defines mpers_source_files
831 srcdir_mpers_source_files = $(patsubst %,$(srcdir)/%,$(mpers_source_files))
832 mpers_preproc_files = $(mpers_source_files:.c=.c.mpers.i)
835 mpers_PREFIX = $(mpers_NAME)_
837 mpers_INCLUDES = $(DEFAULT_INCLUDES) $(INCLUDES)
838 mpers_CPPFLAGS = $(strace_CPPFLAGS) $(CPPFLAGS)
839 mpers_sh_opts = $(mpers_DEFS) $(mpers_INCLUDES) $(mpers_CPPFLAGS)
840 libmpers_CPPFLAGS = $(strace_CPPFLAGS) -DIN_MPERS
841 libmpers_CFLAGS = $(strace_CFLAGS)
845 mpers-m%.stamp: $(srcdir_mpers_source_files) | printers.h
847 CC="$(CC)" CFLAGS="$(mpers_sh_opts) -DMPERS_IS_$(mpers_NAME)" \
848 CPP="$(CPP)" CPPFLAGS="$(mpers_sh_opts) -DIN_MPERS -DMPERS_IS_$(mpers_NAME)" \
849 $(srcdir)/mpers.sh -$(mpers_NAME) $$f || exit; \
853 m%_type_defs.h: $(srcdir_mpers_source_files)
855 sed -r -n 's/^#include DEF_MPERS_TYPE\(([^)]+)\)/#ifdef MPERS_$(mpers_PREFIX)\1\n# define \1 MPERS_$(mpers_PREFIX)\1\n#endif/p' $$f || exit; \
857 echo '#undef MPERS_PRINTER_NAME' >> $@-t
858 echo '#define MPERS_PRINTER_NAME(printer_name) printer_name' >> $@-t
859 echo '#include "$(mpers_PREFIX)printer_decls.h"' >> $@-t
860 echo '#include MPERS_$(mpers_PREFIX)IOCTL_MACROS' >> $@-t
863 m%_funcs.h: $(srcdir_mpers_source_files)
865 sed -r -n 's/^SYS_FUNC\(([^)]+)\)/#undef sys_\1\n#define sys_\1 $(mpers_PREFIX)sys_\1/p' $$f || exit; \
867 echo '#include "sys_func.h"' >> $@-t
872 %.c.mpers.i: $(srcdir)/%.c
873 $(CPP) -P $(mpers_sh_opts) -DIN_MPERS_BOOTSTRAP $< -o $@
875 mpers_printer_decl_pattern = ^MPERS_PRINTER_DECL\(([^,)]+),[[:space:]]*([^,)]+),[[:space:]]*([^)]+)\)$$
877 printers.h: $(mpers_preproc_files)
878 echo '/* Generated by Makefile from $^; do not edit. */' > $@-t
879 echo 'typedef struct {' >> $@-t
881 sed -r -n 's/$(mpers_printer_decl_pattern)/ \1 (*\2)(\3);\n#define \2 MPERS_PRINTER_NAME(\2)\n/p' $$f \
884 echo '} struct_printers;' >> $@-t
885 echo 'extern const struct_printers *printers;' >> $@-t
886 echo '#define MPERS_PRINTER_NAME(printer_name) printers->printer_name' >> $@-t
889 %_printer_decls.h: $(mpers_preproc_files)
890 echo '/* Generated by Makefile from $^; do not edit. */' > $@-t
892 sed -r -n 's/$(mpers_printer_decl_pattern)/extern \1 $(mpers_PREFIX)\2(\3);/p' $$f \
897 %_printer_defs.h: $(mpers_preproc_files)
898 echo '/* Generated by Makefile from $^; do not edit. */' > $@-t
900 sed -r -n 's/$(mpers_printer_decl_pattern)/.\2 = $(mpers_PREFIX)\2,/p' $$f \
905 native_printer_decls.h native_printer_defs.h: mpers_PREFIX =
909 strace_LDADD += libmpers-m32.a
910 noinst_LIBRARIES += libmpers-m32.a
911 libmpers_m32_a_SOURCES = $(mpers_source_files)
912 libmpers_m32_a_CPPFLAGS = $(libmpers_CPPFLAGS) -DMPERS_IS_m32 -I$(builddir)/mpers-m32
913 libmpers_m32_a_CFLAGS = $(libmpers_CFLAGS)
914 mpers_m32_targets = mpers-m32.stamp m32_type_defs.h m32_funcs.h m32_printer_decls.h m32_printer_defs.h
916 BUILT_SOURCES += $(mpers_m32_targets)
917 CLEANFILES += $(mpers_m32_targets)
919 $(mpers_m32_targets): mpers_NAME = m32
921 endif # HAVE_M32_MPERS
925 strace_LDADD += libmpers-mx32.a
926 noinst_LIBRARIES += libmpers-mx32.a
927 libmpers_mx32_a_SOURCES = $(mpers_source_files)
928 libmpers_mx32_a_CPPFLAGS = $(libmpers_CPPFLAGS) -DMPERS_IS_mx32 -I$(builddir)/mpers-mx32
929 libmpers_mx32_a_CFLAGS = $(libmpers_CFLAGS)
930 mpers_mx32_targets = mpers-mx32.stamp mx32_type_defs.h mx32_funcs.h mx32_printer_decls.h mx32_printer_defs.h
932 BUILT_SOURCES += $(mpers_mx32_targets)
933 CLEANFILES += $(mpers_mx32_targets)
935 $(mpers_mx32_targets): mpers_NAME = mx32
937 endif # HAVE_MX32_MPERS
940 -rm -rf mpers-m32 mpers-mx32
944 gen_changelog_start_date = 2009-07-08 20:00
945 $(srcdir)/ChangeLog: $(srcdir)/gitlog-to-changelog $(srcdir)/Makefile.in \
949 ./gitlog-to-changelog --append-dot \
950 --since='$(gen_changelog_start_date)'; \
951 echo; echo; echo 'See ChangeLog-CVS for older changes.' \
956 $(srcdir)/CREDITS: $(srcdir)/CREDITS.in $(srcdir)/.mailmap \
957 $(srcdir)/Makefile.in $(srcdir)/.version
961 sed '/^##/,$$d' CREDITS.in; \
962 { sed -n '1,/^##>/d; s/ */\t/; s/^./&/p' CREDITS.in; \
963 git log --pretty=format:'%aN %aE'; \
964 } | LC_ALL=C sort -u \
965 | awk -F'\t' '{printf("\t%s <%s>\n",$$1,$$2)}'; \
966 ) > $@-t && mv $@-t $@
968 export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner --mode=go-w,go+rX