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 = \
76 # end of libstrace_a_SOURCES
111 fetch_seccomp_fprog.c \
112 fetch_struct_flock.c \
113 fetch_struct_mmsghdr.c \
114 fetch_struct_msghdr.c \
115 fetch_struct_statfs.c \
149 linux/x32/asm_stat.h \
150 linux/x86_64/asm_stat.h \
242 # end of strace_SOURCES
245 strace_SOURCES += unwind.c
246 strace_CPPFLAGS += $(libunwind_CPPFLAGS)
247 strace_LDFLAGS += $(libunwind_LDFLAGS)
248 strace_LDADD += $(libunwind_LIBS)
251 @CODE_COVERAGE_RULES@
252 CODE_COVERAGE_BRANCH_COVERAGE = 1
253 CODE_COVERAGE_GENHTML_OPTIONS = $(CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT) \
254 --prefix $(shell realpath -Ls $(abs_top_srcdir)/..)
255 CODE_COVERAGE_IGNORE_PATTERN = '/usr/include/*'
256 strace_CPPFLAGS += $(CODE_COVERAGE_CPPFLAGS)
257 strace_CFLAGS += $(CODE_COVERAGE_CFLAGS)
258 strace_LDADD += $(CODE_COVERAGE_LDFLAGS)
260 # Enable this to get link map generated
261 #strace_LDFLAGS += -Wl,-Map=strace.mapfile
270 README-linux-ptrace \
276 debian/source/format \
277 debian/strace-udeb.install \
279 debian/strace.examples \
280 debian/strace.install \
281 debian/strace.manpages \
282 debian/strace64.install \
283 debian/strace64.manpages \
288 linux/32/ioctls_inc.h \
289 linux/32/ioctls_inc_align32.h \
290 linux/32/ioctls_inc_align64.h \
291 linux/32/syscallent.h \
292 linux/64/ioctls_inc.h \
293 linux/64/syscallent.h \
294 linux/aarch64/arch_regs.c \
295 linux/aarch64/arch_regs.h \
296 linux/aarch64/arch_sigreturn.c \
297 linux/aarch64/errnoent1.h \
298 linux/aarch64/get_error.c \
299 linux/aarch64/get_scno.c \
300 linux/aarch64/get_syscall_args.c\
301 linux/aarch64/ioctls_arch0.h \
302 linux/aarch64/ioctls_arch1.h \
303 linux/aarch64/ioctls_inc0.h \
304 linux/aarch64/ioctls_inc1.h \
305 linux/aarch64/signalent1.h \
306 linux/aarch64/stat32.h \
307 linux/aarch64/syscallent.h \
308 linux/aarch64/syscallent1.h \
309 linux/alpha/arch_getrval2.c \
310 linux/alpha/arch_regs.c \
311 linux/alpha/arch_regs.h \
312 linux/alpha/arch_sigreturn.c \
313 linux/alpha/errnoent.h \
314 linux/alpha/get_error.c \
315 linux/alpha/get_scno.c \
316 linux/alpha/get_syscall_args.c \
317 linux/alpha/get_syscall_result.c\
318 linux/alpha/ioctls_arch0.h \
319 linux/alpha/ioctls_inc0.h \
320 linux/alpha/signalent.h \
321 linux/alpha/syscallent.h \
322 linux/alpha/userent.h \
323 linux/arc/arch_regs.c \
324 linux/arc/get_error.c \
325 linux/arc/get_scno.c \
326 linux/arc/get_syscall_args.c \
327 linux/arc/ioctls_arch0.h \
328 linux/arc/ioctls_inc0.h \
329 linux/arc/syscallent.h \
331 linux/arch_sigreturn.c \
332 linux/arm/arch_regs.c \
333 linux/arm/arch_regs.h \
334 linux/arm/arch_sigreturn.c \
335 linux/arm/get_error.c \
336 linux/arm/get_scno.c \
337 linux/arm/get_syscall_args.c \
338 linux/arm/ioctls_arch0.h \
339 linux/arm/ioctls_inc0.h \
340 linux/arm/syscallent.h \
341 linux/arm/userent.h \
342 linux/avr32/arch_regs.c \
343 linux/avr32/get_error.c \
344 linux/avr32/get_scno.c \
345 linux/avr32/get_syscall_args.c \
346 linux/avr32/ioctls_arch0.h \
347 linux/avr32/ioctls_inc0.h \
348 linux/avr32/syscallent.h \
349 linux/avr32/userent.h \
350 linux/bfin/arch_regs.c \
351 linux/bfin/get_error.c \
352 linux/bfin/get_scno.c \
353 linux/bfin/get_syscall_args.c \
354 linux/bfin/get_syscall_result.c \
355 linux/bfin/ioctls_arch0.h \
356 linux/bfin/ioctls_inc0.h \
357 linux/bfin/syscallent.h \
358 linux/bfin/userent.h \
359 linux/crisv10/arch_regs.c \
360 linux/crisv10/arch_sigreturn.c \
361 linux/crisv10/get_error.c \
362 linux/crisv10/get_scno.c \
363 linux/crisv10/get_syscall_args.c \
364 linux/crisv10/get_syscall_result.c \
365 linux/crisv10/userent.h \
366 linux/crisv32/arch_regs.c \
367 linux/crisv32/arch_sigreturn.c \
368 linux/crisv32/get_error.c \
369 linux/crisv32/get_scno.c \
370 linux/crisv32/get_syscall_args.c \
371 linux/crisv32/get_syscall_result.c \
372 linux/crisv32/userent.h \
375 linux/hppa/arch_regs.c \
376 linux/hppa/arch_regs.h \
377 linux/hppa/errnoent.h \
378 linux/hppa/get_error.c \
379 linux/hppa/get_scno.c \
380 linux/hppa/get_syscall_args.c \
381 linux/hppa/get_syscall_result.c \
382 linux/hppa/ioctls_arch0.h \
383 linux/hppa/ioctls_inc0.h \
384 linux/hppa/signalent.h \
385 linux/hppa/syscallent.h \
386 linux/i386/arch_regs.c \
387 linux/i386/arch_regs.h \
388 linux/i386/arch_sigreturn.c \
389 linux/i386/get_error.c \
390 linux/i386/get_scno.c \
391 linux/i386/get_syscall_args.c \
392 linux/i386/ioctls_arch0.h \
393 linux/i386/ioctls_inc0.h \
394 linux/i386/syscallent.h \
395 linux/i386/userent.h \
396 linux/i386/userent0.h \
397 linux/ia64/arch_getrval2.c \
398 linux/ia64/arch_regs.c \
399 linux/ia64/arch_regs.h \
400 linux/ia64/arch_sigreturn.c \
401 linux/ia64/get_error.c \
402 linux/ia64/get_scno.c \
403 linux/ia64/get_syscall_args.c \
404 linux/ia64/ioctls_arch0.h \
405 linux/ia64/ioctls_inc0.h \
406 linux/ia64/syscallent.h \
407 linux/ia64/userent.h \
409 linux/m68k/arch_regs.c \
410 linux/m68k/arch_sigreturn.c \
411 linux/m68k/get_error.c \
412 linux/m68k/get_scno.c \
413 linux/m68k/get_syscall_args.c \
414 linux/m68k/get_syscall_result.c \
415 linux/m68k/ioctls_arch0.h \
416 linux/m68k/ioctls_inc0.h \
417 linux/m68k/syscallent.h \
418 linux/m68k/userent.h \
419 linux/metag/arch_regs.c \
420 linux/metag/get_error.c \
421 linux/metag/get_scno.c \
422 linux/metag/get_syscall_args.c \
423 linux/metag/ioctls_arch0.h \
424 linux/metag/ioctls_inc0.h \
425 linux/metag/syscallent.h \
426 linux/microblaze/arch_regs.c \
427 linux/microblaze/arch_sigreturn.c \
428 linux/microblaze/get_error.c \
429 linux/microblaze/get_scno.c \
430 linux/microblaze/get_syscall_args.c \
431 linux/microblaze/get_syscall_result.c \
432 linux/microblaze/ioctls_arch0.h \
433 linux/microblaze/ioctls_inc0.h \
434 linux/microblaze/syscallent.h \
435 linux/microblaze/userent.h \
436 linux/mips/arch_getrval2.c \
437 linux/mips/arch_regs.c \
438 linux/mips/arch_regs.h \
439 linux/mips/arch_sigreturn.c \
440 linux/mips/errnoent.h \
441 linux/mips/genstub.sh \
442 linux/mips/get_error.c \
443 linux/mips/get_scno.c \
444 linux/mips/get_syscall_args.c \
445 linux/mips/ioctls_arch0.h \
446 linux/mips/ioctls_inc0.h \
447 linux/mips/signalent.h \
448 linux/mips/syscallent-compat.h \
449 linux/mips/syscallent-n32.h \
450 linux/mips/syscallent-n64.h \
451 linux/mips/syscallent-o32.h \
452 linux/mips/syscallent.h \
453 linux/mips/userent.h \
455 linux/netlink_diag.h \
456 linux/nios2/arch_regs.c \
457 linux/nios2/get_error.c \
458 linux/nios2/get_scno.c \
459 linux/nios2/get_syscall_args.c \
460 linux/nios2/ioctls_arch0.h \
461 linux/nios2/ioctls_inc0.h \
462 linux/nios2/syscallent.h \
463 linux/or1k/arch_regs.c \
464 linux/or1k/get_error.c \
465 linux/or1k/get_scno.c \
466 linux/or1k/get_syscall_args.c \
467 linux/or1k/ioctls_arch0.h \
468 linux/or1k/ioctls_inc0.h \
469 linux/or1k/syscallent.h \
470 linux/or1k/userent.h \
471 linux/personality.h \
472 linux/powerpc/arch_regs.c \
473 linux/powerpc/arch_regs.h \
474 linux/powerpc/arch_sigreturn.c \
475 linux/powerpc/errnoent.h \
476 linux/powerpc/get_error.c \
477 linux/powerpc/get_scno.c \
478 linux/powerpc/get_syscall_args.c \
479 linux/powerpc/getregs_old.c \
480 linux/powerpc/ioctls_arch0.h \
481 linux/powerpc/ioctls_inc0.h \
482 linux/powerpc/syscallent.h \
483 linux/powerpc/userent.h \
484 linux/powerpc64/arch_regs.c \
485 linux/powerpc64/arch_regs.h \
486 linux/powerpc64/arch_sigreturn.c \
487 linux/powerpc64/errnoent.h \
488 linux/powerpc64/errnoent1.h \
489 linux/powerpc64/get_error.c \
490 linux/powerpc64/get_scno.c \
491 linux/powerpc64/get_syscall_args.c \
492 linux/powerpc64/getregs_old.c \
493 linux/powerpc64/ioctls_arch0.h \
494 linux/powerpc64/ioctls_arch1.h \
495 linux/powerpc64/ioctls_inc0.h \
496 linux/powerpc64/ioctls_inc1.h \
497 linux/powerpc64/signalent1.h \
498 linux/powerpc64/stat32.h \
499 linux/powerpc64/syscallent.h \
500 linux/powerpc64/syscallent1.h \
501 linux/powerpc64/userent.h \
503 linux/riscv/arch_regs.c \
504 linux/riscv/errnoent1.h \
505 linux/riscv/get_error.c \
506 linux/riscv/get_scno.c \
507 linux/riscv/get_syscall_args.c \
508 linux/riscv/ioctls_arch0.h \
509 linux/riscv/ioctls_arch1.h \
510 linux/riscv/ioctls_inc0.h \
511 linux/riscv/ioctls_inc1.h \
512 linux/riscv/signalent1.h \
513 linux/riscv/stat32.h \
514 linux/riscv/syscallent.h \
515 linux/riscv/syscallent1.h \
516 linux/s390/arch_regs.c \
517 linux/s390/arch_regs.h \
518 linux/s390/arch_sigreturn.c \
519 linux/s390/get_error.c \
520 linux/s390/get_scno.c \
521 linux/s390/get_syscall_args.c \
522 linux/s390/ioctls_arch0.h \
523 linux/s390/ioctls_inc0.h \
524 linux/s390/syscallent.h \
525 linux/s390/userent.h \
526 linux/s390/userent0.h \
527 linux/s390/userent1.h \
528 linux/s390x/arch_regs.c \
529 linux/s390x/arch_regs.h \
530 linux/s390x/arch_sigreturn.c \
531 linux/s390x/get_error.c \
532 linux/s390x/get_scno.c \
533 linux/s390x/get_syscall_args.c \
534 linux/s390x/ioctls_arch0.h \
535 linux/s390x/ioctls_inc0.h \
536 linux/s390x/syscallent.h \
537 linux/s390x/userent.h \
538 linux/sh/arch_getrval2.c \
539 linux/sh/arch_regs.c \
540 linux/sh/get_error.c \
541 linux/sh/get_scno.c \
542 linux/sh/get_syscall_args.c \
543 linux/sh/get_syscall_result.c \
544 linux/sh/ioctls_arch0.h \
545 linux/sh/ioctls_inc0.h \
546 linux/sh/syscallent.h \
548 linux/sh/userent0.h \
549 linux/sh64/arch_regs.c \
550 linux/sh64/arch_regs.h \
551 linux/sh64/get_error.c \
552 linux/sh64/get_scno.c \
553 linux/sh64/get_syscall_args.c \
554 linux/sh64/get_syscall_result.c \
555 linux/sh64/ioctls_arch0.h \
556 linux/sh64/ioctls_inc0.h \
557 linux/sh64/syscallent.h \
558 linux/sh64/userent.h \
561 linux/sparc/arch_getrval2.c \
562 linux/sparc/arch_regs.c \
563 linux/sparc/arch_regs.h \
564 linux/sparc/arch_sigreturn.c \
565 linux/sparc/errnoent.h \
567 linux/sparc/get_error.c \
568 linux/sparc/get_scno.c \
569 linux/sparc/get_syscall_args.c \
570 linux/sparc/ioctls_arch0.h \
571 linux/sparc/ioctls_inc0.h \
572 linux/sparc/signalent.h \
573 linux/sparc/syscallent.h \
574 linux/sparc/userent.h \
575 linux/sparc64/arch_getrval2.c \
576 linux/sparc64/arch_regs.c \
577 linux/sparc64/arch_regs.h \
578 linux/sparc64/arch_sigreturn.c \
579 linux/sparc64/errnoent.h \
580 linux/sparc64/errnoent1.h \
581 linux/sparc64/get_error.c \
582 linux/sparc64/get_scno.c \
583 linux/sparc64/get_syscall_args.c\
584 linux/sparc64/ioctls_arch0.h \
585 linux/sparc64/ioctls_arch1.h \
586 linux/sparc64/ioctls_inc0.h \
587 linux/sparc64/ioctls_inc1.h \
588 linux/sparc64/signalent.h \
589 linux/sparc64/signalent1.h \
590 linux/sparc64/stat32.h \
591 linux/sparc64/syscallent.h \
592 linux/sparc64/syscallent1.h \
593 linux/sparc64/userent.h \
596 linux/tile/arch_regs.c \
597 linux/tile/arch_regs.h \
598 linux/tile/arch_sigreturn.c \
599 linux/tile/errnoent1.h \
600 linux/tile/get_error.c \
601 linux/tile/get_scno.c \
602 linux/tile/get_syscall_args.c \
603 linux/tile/ioctls_arch0.h \
604 linux/tile/ioctls_arch1.h \
605 linux/tile/ioctls_inc0.h \
606 linux/tile/ioctls_inc1.h \
607 linux/tile/signalent1.h \
608 linux/tile/stat32.h \
609 linux/tile/syscallent.h \
610 linux/tile/syscallent1.h \
611 linux/tile/userent.h \
616 linux/x32/arch_regs.c \
617 linux/x32/arch_regs.h \
618 linux/x32/arch_sigreturn.c \
619 linux/x32/errnoent1.h \
620 linux/x32/get_error.c \
621 linux/x32/get_scno.c \
622 linux/x32/get_syscall_args.c \
623 linux/x32/ioctls_arch0.h \
624 linux/x32/ioctls_arch1.h \
625 linux/x32/ioctls_inc0.h \
626 linux/x32/ioctls_inc1.h \
627 linux/x32/signalent1.h \
629 linux/x32/syscallent.h \
630 linux/x32/syscallent1.h \
631 linux/x32/userent.h \
632 linux/x86_64/arch_regs.c \
633 linux/x86_64/arch_regs.h \
634 linux/x86_64/arch_sigreturn.c \
635 linux/x86_64/errnoent1.h \
636 linux/x86_64/errnoent2.h \
637 linux/x86_64/gentab.pl \
638 linux/x86_64/get_error.c \
639 linux/x86_64/get_scno.c \
640 linux/x86_64/get_syscall_args.c \
641 linux/x86_64/getregs_old.c \
642 linux/x86_64/ioctls_arch0.h \
643 linux/x86_64/ioctls_arch1.h \
644 linux/x86_64/ioctls_arch2.h \
645 linux/x86_64/ioctls_inc0.h \
646 linux/x86_64/ioctls_inc1.h \
647 linux/x86_64/ioctls_inc2.h \
648 linux/x86_64/signalent1.h \
649 linux/x86_64/signalent2.h \
650 linux/x86_64/stat32.h \
651 linux/x86_64/syscallent.h \
652 linux/x86_64/syscallent1.h \
653 linux/x86_64/syscallent2.h \
654 linux/x86_64/userent.h \
655 linux/xtensa/arch_regs.c \
656 linux/xtensa/get_error.c \
657 linux/xtensa/get_scno.c \
658 linux/xtensa/get_syscall_args.c \
659 linux/xtensa/get_syscall_result.c \
660 linux/xtensa/ioctls_arch0.h \
661 linux/xtensa/ioctls_inc0.h \
662 linux/xtensa/syscallent.h \
663 linux/xtensa/userent.h \
664 maint/ioctls_gen.sh \
665 maint/ioctls_hex.sh \
666 maint/ioctls_sym.sh \
667 maint/print_ioctlent.c \
677 $(XLAT_INPUT_FILES) \
678 $(XLAT_HEADER_FILES) \
684 rpmbuild --define '%_srcrpmdir .' -ts $(distdir).tar.xz
687 $(AM_V_GEN)echo $(VERSION) > $@-t && mv $@-t $@
690 $(filter %.c,$(strace_SOURCES)) $(filter %.c,$(libstrace_a_SOURCES))
692 sys_func.h: $(patsubst %,$(srcdir)/%,$(strace_SOURCES_c))
694 sed -n 's/^SYS_FUNC(.*/extern &;/p' $$f; \
697 syscallent_names = subcall.h syscallent.h syscallent1.h \
698 syscallent-n32.h syscallent-n64.h syscallent-o32.h
699 syscallent_patterns = $(patsubst %,\%/%,$(syscallent_names))
700 syscallent_files = $(filter $(syscallent_patterns),$(EXTRA_DIST))
702 sen.h: $(patsubst %,$(srcdir)/%,$(syscallent_files))
703 for f in $^; do cat -- $$f; done | \
704 $(srcdir)/generate_sen.sh > $@
707 $(AM_V_GEN)echo $(VERSION) > $(distdir)/.tarball-version
709 today = $(shell date +%Y-%m-%d)
710 version_regexp = $(subst .,\.,$(VERSION))
711 news_check_regexp = 'Noteworthy changes in release $(version_regexp) ($(today))'
714 $(AM_V_GEN)if head -1 $< | \
715 grep -x $(news_check_regexp) >/dev/null; then \
718 echo >&2 '$<: check failed'; \
722 ioctlsort_CC = $(CC_FOR_BUILD)
723 ioctlsort_DEFS = $(DEFS)
724 ioctlsort_INCLUDES = $(DEFAULT_INCLUDES) $(INCLUDES)
725 ioctlsort_CPPFLAGS = $(AM_CPPFLAGS) $(CPPFLAGS_FOR_BUILD)
726 ioctlsort_CFLAGS = $(AM_CFLAGS) $(CFLAGS_FOR_BUILD)
727 ioctlsort_LDFLAGS = $(AM_LDFLAGS) $(LDFLAGS_FOR_BUILD)
729 ioctls_inc_h = $(wildcard $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h)
730 ioctlent_h = $(patsubst $(srcdir)/$(OS)/$(ARCH)/ioctls_inc%,ioctlent%,$(ioctls_inc_h))
731 ioctl_redefs_h = $(filter-out ioctl_redefs0.h,$(subst ioctlent,ioctl_redefs,$(ioctlent_h)))
733 ioctl_redefs%.h: ioctlent%.h ioctlent0.h
735 sort ioctlent0.h | comm -23 $<-t - | \
736 sed -r -n 's/^\{ "([^"]+)", (0x[[:xdigit:]]+) \},$$/#ifdef \1\n# undef \1\n# define \1 \2\n#endif/p' \
741 ioctlent%.h: ioctlsort%
744 ioctlsort%$(BUILD_EXEEXT): ioctlsort%.o
745 $(ioctlsort_CC) $(ioctlsort_CFLAGS) $(ioctlsort_LDFLAGS) $< -o $@
747 ioctlsort%.o: ioctls_all%.h $(srcdir)/ioctlsort.c
748 $(ioctlsort_CC) $(ioctlsort_DEFS) $(ioctlsort_INCLUDES) $(ioctlsort_CPPFLAGS) $(ioctlsort_CFLAGS) -DIOCTLSORT_INC=\"$<\" -c -o $@ $(srcdir)/ioctlsort.c
750 ioctls_all%.h: $(srcdir)/$(OS)/$(ARCH)/ioctls_inc%.h $(srcdir)/$(OS)/$(ARCH)/ioctls_arch%.h
753 BUILT_SOURCES = $(ioctl_redefs_h) $(ioctlent_h) \
754 native_printer_decls.h native_printer_defs.h printers.h sen.h sys_func.h .version
755 CLEANFILES = $(ioctl_redefs_h) $(ioctlent_h) $(mpers_preproc_files) \
756 native_printer_decls.h native_printer_defs.h printers.h sen.h sys_func.h
757 DISTCLEANFILES = gnu/stubs-32.h gnu/stubs-x32.h
759 # defines mpers_source_files
761 srcdir_mpers_source_files = $(patsubst %,$(srcdir)/%,$(mpers_source_files))
762 mpers_preproc_files = $(mpers_source_files:.c=.c.mpers.i)
765 mpers_PREFIX = $(mpers_NAME)_
767 mpers_INCLUDES = $(DEFAULT_INCLUDES) $(INCLUDES)
768 mpers_CPPFLAGS = $(strace_CPPFLAGS) $(CPPFLAGS)
769 mpers_sh_opts = $(mpers_DEFS) $(mpers_INCLUDES) $(mpers_CPPFLAGS)
770 libmpers_CPPFLAGS = $(strace_CPPFLAGS) -DIN_MPERS
771 libmpers_CFLAGS = $(strace_CFLAGS)
775 mpers-m%.stamp: $(srcdir_mpers_source_files) | printers.h
777 CC="$(CC)" CFLAGS="$(mpers_sh_opts) -DMPERS_IS_$(mpers_NAME)" \
778 CPP="$(CPP)" CPPFLAGS="$(mpers_sh_opts) -DIN_MPERS -DMPERS_IS_$(mpers_NAME)" \
779 $(srcdir)/mpers.sh -$(mpers_NAME) $$f || exit; \
783 m%_type_defs.h: $(srcdir_mpers_source_files)
785 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; \
787 echo '#undef MPERS_PRINTER_NAME' >> $@-t
788 echo '#define MPERS_PRINTER_NAME(printer_name) printer_name' >> $@-t
789 echo '#include "$(mpers_PREFIX)printer_decls.h"' >> $@-t
790 echo '#include MPERS_$(mpers_PREFIX)IOCTL_MACROS' >> $@-t
793 m%_funcs.h: $(srcdir_mpers_source_files)
795 sed -r -n 's/^SYS_FUNC\(([^)]+)\)/#undef sys_\1\n#define sys_\1 $(mpers_PREFIX)sys_\1/p' $$f || exit; \
797 echo '#include "sys_func.h"' >> $@-t
802 %.c.mpers.i: $(srcdir)/%.c
803 $(CPP) -P $(mpers_sh_opts) -DIN_MPERS_BOOTSTRAP $< -o $@
805 mpers_printer_decl_pattern = ^MPERS_PRINTER_DECL\(([^,)]+),[[:space:]]*([^,)]+),[[:space:]]*([^)]+)\)$$
807 printers.h: $(mpers_preproc_files)
808 echo '/* Generated by Makefile from $^; do not edit. */' > $@-t
809 echo 'typedef struct {' >> $@-t
811 sed -r -n 's/$(mpers_printer_decl_pattern)/ \1 (*\2)(\3);\n#define \2 MPERS_PRINTER_NAME(\2)\n/p' $$f \
814 echo '} struct_printers;' >> $@-t
815 echo 'extern const struct_printers *printers;' >> $@-t
816 echo '#define MPERS_PRINTER_NAME(printer_name) printers->printer_name' >> $@-t
819 %_printer_decls.h: $(mpers_preproc_files)
820 echo '/* Generated by Makefile from $^; do not edit. */' > $@-t
822 sed -r -n 's/$(mpers_printer_decl_pattern)/extern \1 $(mpers_PREFIX)\2(\3);/p' $$f \
827 %_printer_defs.h: $(mpers_preproc_files)
828 echo '/* Generated by Makefile from $^; do not edit. */' > $@-t
830 sed -r -n 's/$(mpers_printer_decl_pattern)/.\2 = $(mpers_PREFIX)\2,/p' $$f \
835 native_printer_decls.h native_printer_defs.h: mpers_PREFIX =
839 strace_LDADD += libmpers-m32.a
840 noinst_LIBRARIES += libmpers-m32.a
841 libmpers_m32_a_SOURCES = $(mpers_source_files)
842 libmpers_m32_a_CPPFLAGS = $(libmpers_CPPFLAGS) -DMPERS_IS_m32 -I$(builddir)/mpers-m32
843 libmpers_m32_a_CFLAGS = $(libmpers_CFLAGS)
844 mpers_m32_targets = mpers-m32.stamp m32_type_defs.h m32_funcs.h m32_printer_decls.h m32_printer_defs.h
846 BUILT_SOURCES += $(mpers_m32_targets)
847 CLEANFILES += $(mpers_m32_targets)
849 $(mpers_m32_targets): mpers_NAME = m32
851 endif # HAVE_M32_MPERS
855 strace_LDADD += libmpers-mx32.a
856 noinst_LIBRARIES += libmpers-mx32.a
857 libmpers_mx32_a_SOURCES = $(mpers_source_files)
858 libmpers_mx32_a_CPPFLAGS = $(libmpers_CPPFLAGS) -DMPERS_IS_mx32 -I$(builddir)/mpers-mx32
859 libmpers_mx32_a_CFLAGS = $(libmpers_CFLAGS)
860 mpers_mx32_targets = mpers-mx32.stamp mx32_type_defs.h mx32_funcs.h mx32_printer_decls.h mx32_printer_defs.h
862 BUILT_SOURCES += $(mpers_mx32_targets)
863 CLEANFILES += $(mpers_mx32_targets)
865 $(mpers_mx32_targets): mpers_NAME = mx32
867 endif # HAVE_MX32_MPERS
870 -rm -rf mpers-m32 mpers-mx32
874 gen_changelog_start_date = 2009-07-08 20:00
875 $(srcdir)/ChangeLog: $(srcdir)/gitlog-to-changelog $(srcdir)/Makefile.in \
879 ./gitlog-to-changelog --append-dot \
880 --since='$(gen_changelog_start_date)'; \
881 echo; echo; echo 'See ChangeLog-CVS for older changes.' \
886 $(srcdir)/CREDITS: $(srcdir)/CREDITS.in $(srcdir)/.mailmap \
887 $(srcdir)/Makefile.in $(srcdir)/.version
891 sed '/^##/,$$d' CREDITS.in; \
892 { sed -n '1,/^##>/d; s/ */\t/; s/^./&/p' CREDITS.in; \
893 git log --pretty=format:'%aN %aE'; \
894 } | LC_ALL=C sort -u \
895 | awk -F'\t' '{printf("\t%s <%s>\n",$$1,$$2)}'; \
896 ) > $@-t && mv $@-t $@
898 export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner --mode=go-w,go+rX