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 = \
74 # end of libstrace_a_SOURCES
109 fetch_seccomp_fprog.c \
110 fetch_struct_flock.c \
111 fetch_struct_statfs.c \
143 linux/x32/asm_stat.h \
229 # end of strace_SOURCES
232 strace_SOURCES += unwind.c
233 strace_CPPFLAGS += $(libunwind_CPPFLAGS)
234 strace_LDFLAGS += $(libunwind_LDFLAGS)
235 strace_LDADD += $(libunwind_LIBS)
238 @CODE_COVERAGE_RULES@
239 CODE_COVERAGE_BRANCH_COVERAGE = 1
240 CODE_COVERAGE_GENHTML_OPTIONS = $(CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT) \
241 --prefix $(shell realpath -Ls $(abs_top_srcdir)/..)
242 CODE_COVERAGE_IGNORE_PATTERN = '/usr/include/*'
243 strace_CPPFLAGS += $(CODE_COVERAGE_CPPFLAGS)
244 strace_CFLAGS += $(CODE_COVERAGE_CFLAGS)
245 strace_LDADD += $(CODE_COVERAGE_LDFLAGS)
247 # Enable this to get link map generated
248 #strace_LDFLAGS += -Wl,-Map=strace.mapfile
257 README-linux-ptrace \
263 debian/source/format \
264 debian/strace-udeb.install \
266 debian/strace.examples \
267 debian/strace.install \
268 debian/strace.manpages \
269 debian/strace64.install \
270 debian/strace64.manpages \
275 linux/32/ioctls_inc.h \
276 linux/32/ioctls_inc_align32.h \
277 linux/32/ioctls_inc_align64.h \
278 linux/32/syscallent.h \
279 linux/64/ioctls_inc.h \
280 linux/64/syscallent.h \
281 linux/aarch64/arch_regs.c \
282 linux/aarch64/arch_regs.h \
283 linux/aarch64/arch_sigreturn.c \
284 linux/aarch64/errnoent1.h \
285 linux/aarch64/get_error.c \
286 linux/aarch64/get_scno.c \
287 linux/aarch64/get_syscall_args.c\
288 linux/aarch64/ioctls_arch0.h \
289 linux/aarch64/ioctls_arch1.h \
290 linux/aarch64/ioctls_inc0.h \
291 linux/aarch64/ioctls_inc1.h \
292 linux/aarch64/signalent1.h \
293 linux/aarch64/syscallent.h \
294 linux/aarch64/syscallent1.h \
295 linux/alpha/arch_getrval2.c \
296 linux/alpha/arch_regs.c \
297 linux/alpha/arch_regs.h \
298 linux/alpha/arch_sigreturn.c \
299 linux/alpha/errnoent.h \
300 linux/alpha/get_error.c \
301 linux/alpha/get_scno.c \
302 linux/alpha/get_syscall_args.c \
303 linux/alpha/get_syscall_result.c\
304 linux/alpha/ioctls_arch0.h \
305 linux/alpha/ioctls_inc0.h \
306 linux/alpha/signalent.h \
307 linux/alpha/syscallent.h \
308 linux/alpha/userent.h \
309 linux/arc/arch_regs.c \
310 linux/arc/get_error.c \
311 linux/arc/get_scno.c \
312 linux/arc/get_syscall_args.c \
313 linux/arc/ioctls_arch0.h \
314 linux/arc/ioctls_inc0.h \
315 linux/arc/syscallent.h \
317 linux/arch_sigreturn.c \
318 linux/arm/arch_regs.c \
319 linux/arm/arch_regs.h \
320 linux/arm/arch_sigreturn.c \
321 linux/arm/get_error.c \
322 linux/arm/get_scno.c \
323 linux/arm/get_syscall_args.c \
324 linux/arm/ioctls_arch0.h \
325 linux/arm/ioctls_inc0.h \
326 linux/arm/syscallent.h \
327 linux/arm/userent.h \
328 linux/avr32/arch_regs.c \
329 linux/avr32/get_error.c \
330 linux/avr32/get_scno.c \
331 linux/avr32/get_syscall_args.c \
332 linux/avr32/ioctls_arch0.h \
333 linux/avr32/ioctls_inc0.h \
334 linux/avr32/syscallent.h \
335 linux/avr32/userent.h \
336 linux/bfin/arch_regs.c \
337 linux/bfin/get_error.c \
338 linux/bfin/get_scno.c \
339 linux/bfin/get_syscall_args.c \
340 linux/bfin/get_syscall_result.c \
341 linux/bfin/ioctls_arch0.h \
342 linux/bfin/ioctls_inc0.h \
343 linux/bfin/syscallent.h \
344 linux/bfin/userent.h \
345 linux/crisv10/arch_regs.c \
346 linux/crisv10/arch_sigreturn.c \
347 linux/crisv10/get_error.c \
348 linux/crisv10/get_scno.c \
349 linux/crisv10/get_syscall_args.c \
350 linux/crisv10/get_syscall_result.c \
351 linux/crisv10/userent.h \
352 linux/crisv32/arch_regs.c \
353 linux/crisv32/arch_sigreturn.c \
354 linux/crisv32/get_error.c \
355 linux/crisv32/get_scno.c \
356 linux/crisv32/get_syscall_args.c \
357 linux/crisv32/get_syscall_result.c \
358 linux/crisv32/userent.h \
361 linux/hppa/arch_regs.c \
362 linux/hppa/arch_regs.h \
363 linux/hppa/errnoent.h \
364 linux/hppa/get_error.c \
365 linux/hppa/get_scno.c \
366 linux/hppa/get_syscall_args.c \
367 linux/hppa/get_syscall_result.c \
368 linux/hppa/ioctls_arch0.h \
369 linux/hppa/ioctls_inc0.h \
370 linux/hppa/signalent.h \
371 linux/hppa/syscallent.h \
372 linux/i386/arch_regs.c \
373 linux/i386/arch_regs.h \
374 linux/i386/arch_sigreturn.c \
375 linux/i386/get_error.c \
376 linux/i386/get_scno.c \
377 linux/i386/get_syscall_args.c \
378 linux/i386/ioctls_arch0.h \
379 linux/i386/ioctls_inc0.h \
380 linux/i386/syscallent.h \
381 linux/i386/userent.h \
382 linux/i386/userent0.h \
383 linux/ia64/arch_getrval2.c \
384 linux/ia64/arch_regs.c \
385 linux/ia64/arch_regs.h \
386 linux/ia64/arch_sigreturn.c \
387 linux/ia64/get_error.c \
388 linux/ia64/get_scno.c \
389 linux/ia64/get_syscall_args.c \
390 linux/ia64/ioctls_arch0.h \
391 linux/ia64/ioctls_inc0.h \
392 linux/ia64/syscallent.h \
393 linux/ia64/userent.h \
395 linux/m68k/arch_regs.c \
396 linux/m68k/arch_sigreturn.c \
397 linux/m68k/get_error.c \
398 linux/m68k/get_scno.c \
399 linux/m68k/get_syscall_args.c \
400 linux/m68k/get_syscall_result.c \
401 linux/m68k/ioctls_arch0.h \
402 linux/m68k/ioctls_inc0.h \
403 linux/m68k/syscallent.h \
404 linux/m68k/userent.h \
405 linux/metag/arch_regs.c \
406 linux/metag/get_error.c \
407 linux/metag/get_scno.c \
408 linux/metag/get_syscall_args.c \
409 linux/metag/ioctls_arch0.h \
410 linux/metag/ioctls_inc0.h \
411 linux/metag/syscallent.h \
412 linux/microblaze/arch_regs.c \
413 linux/microblaze/arch_sigreturn.c \
414 linux/microblaze/get_error.c \
415 linux/microblaze/get_scno.c \
416 linux/microblaze/get_syscall_args.c \
417 linux/microblaze/get_syscall_result.c \
418 linux/microblaze/ioctls_arch0.h \
419 linux/microblaze/ioctls_inc0.h \
420 linux/microblaze/syscallent.h \
421 linux/microblaze/userent.h \
422 linux/mips/arch_getrval2.c \
423 linux/mips/arch_regs.c \
424 linux/mips/arch_regs.h \
425 linux/mips/arch_sigreturn.c \
426 linux/mips/errnoent.h \
427 linux/mips/genstub.sh \
428 linux/mips/get_error.c \
429 linux/mips/get_scno.c \
430 linux/mips/get_syscall_args.c \
431 linux/mips/ioctls_arch0.h \
432 linux/mips/ioctls_inc0.h \
433 linux/mips/signalent.h \
434 linux/mips/syscallent-compat.h \
435 linux/mips/syscallent-n32.h \
436 linux/mips/syscallent-n64.h \
437 linux/mips/syscallent-o32.h \
438 linux/mips/syscallent.h \
439 linux/mips/userent.h \
441 linux/netlink_diag.h \
442 linux/nios2/arch_regs.c \
443 linux/nios2/get_error.c \
444 linux/nios2/get_scno.c \
445 linux/nios2/get_syscall_args.c \
446 linux/nios2/ioctls_arch0.h \
447 linux/nios2/ioctls_inc0.h \
448 linux/nios2/syscallent.h \
449 linux/or1k/arch_regs.c \
450 linux/or1k/get_error.c \
451 linux/or1k/get_scno.c \
452 linux/or1k/get_syscall_args.c \
453 linux/or1k/ioctls_arch0.h \
454 linux/or1k/ioctls_inc0.h \
455 linux/or1k/syscallent.h \
456 linux/or1k/userent.h \
457 linux/personality.h \
458 linux/powerpc/arch_regs.c \
459 linux/powerpc/arch_regs.h \
460 linux/powerpc/arch_sigreturn.c \
461 linux/powerpc/errnoent.h \
462 linux/powerpc/get_error.c \
463 linux/powerpc/get_scno.c \
464 linux/powerpc/get_syscall_args.c \
465 linux/powerpc/getregs_old.c \
466 linux/powerpc/ioctls_arch0.h \
467 linux/powerpc/ioctls_inc0.h \
468 linux/powerpc/syscallent.h \
469 linux/powerpc/userent.h \
470 linux/powerpc64/arch_regs.c \
471 linux/powerpc64/arch_regs.h \
472 linux/powerpc64/arch_sigreturn.c \
473 linux/powerpc64/errnoent.h \
474 linux/powerpc64/errnoent1.h \
475 linux/powerpc64/get_error.c \
476 linux/powerpc64/get_scno.c \
477 linux/powerpc64/get_syscall_args.c \
478 linux/powerpc64/getregs_old.c \
479 linux/powerpc64/ioctls_arch0.h \
480 linux/powerpc64/ioctls_arch1.h \
481 linux/powerpc64/ioctls_inc0.h \
482 linux/powerpc64/ioctls_inc1.h \
483 linux/powerpc64/signalent1.h \
484 linux/powerpc64/syscallent.h \
485 linux/powerpc64/syscallent1.h \
486 linux/powerpc64/userent.h \
488 linux/s390/arch_regs.c \
489 linux/s390/arch_regs.h \
490 linux/s390/arch_sigreturn.c \
491 linux/s390/get_error.c \
492 linux/s390/get_scno.c \
493 linux/s390/get_syscall_args.c \
494 linux/s390/ioctls_arch0.h \
495 linux/s390/ioctls_inc0.h \
496 linux/s390/syscallent.h \
497 linux/s390/userent.h \
498 linux/s390/userent0.h \
499 linux/s390/userent1.h \
500 linux/s390x/arch_regs.c \
501 linux/s390x/arch_regs.h \
502 linux/s390x/arch_sigreturn.c \
503 linux/s390x/get_error.c \
504 linux/s390x/get_scno.c \
505 linux/s390x/get_syscall_args.c \
506 linux/s390x/ioctls_arch0.h \
507 linux/s390x/ioctls_inc0.h \
508 linux/s390x/syscallent.h \
509 linux/s390x/userent.h \
510 linux/sh/arch_getrval2.c \
511 linux/sh/arch_regs.c \
512 linux/sh/get_error.c \
513 linux/sh/get_scno.c \
514 linux/sh/get_syscall_args.c \
515 linux/sh/get_syscall_result.c \
516 linux/sh/ioctls_arch0.h \
517 linux/sh/ioctls_inc0.h \
518 linux/sh/syscallent.h \
520 linux/sh/userent0.h \
521 linux/sh64/arch_regs.c \
522 linux/sh64/arch_regs.h \
523 linux/sh64/get_error.c \
524 linux/sh64/get_scno.c \
525 linux/sh64/get_syscall_args.c \
526 linux/sh64/get_syscall_result.c \
527 linux/sh64/ioctls_arch0.h \
528 linux/sh64/ioctls_inc0.h \
529 linux/sh64/syscallent.h \
530 linux/sh64/userent.h \
533 linux/sparc/arch_getrval2.c \
534 linux/sparc/arch_regs.c \
535 linux/sparc/arch_regs.h \
536 linux/sparc/arch_sigreturn.c \
537 linux/sparc/errnoent.h \
539 linux/sparc/get_error.c \
540 linux/sparc/get_scno.c \
541 linux/sparc/get_syscall_args.c \
542 linux/sparc/ioctls_arch0.h \
543 linux/sparc/ioctls_inc0.h \
544 linux/sparc/signalent.h \
545 linux/sparc/syscallent.h \
546 linux/sparc/userent.h \
547 linux/sparc64/arch_getrval2.c \
548 linux/sparc64/arch_regs.c \
549 linux/sparc64/arch_regs.h \
550 linux/sparc64/arch_sigreturn.c \
551 linux/sparc64/errnoent.h \
552 linux/sparc64/errnoent1.h \
553 linux/sparc64/get_error.c \
554 linux/sparc64/get_scno.c \
555 linux/sparc64/get_syscall_args.c\
556 linux/sparc64/ioctls_arch0.h \
557 linux/sparc64/ioctls_arch1.h \
558 linux/sparc64/ioctls_inc0.h \
559 linux/sparc64/ioctls_inc1.h \
560 linux/sparc64/signalent.h \
561 linux/sparc64/signalent1.h \
562 linux/sparc64/syscallent.h \
563 linux/sparc64/syscallent1.h \
564 linux/sparc64/userent.h \
567 linux/tile/arch_regs.c \
568 linux/tile/arch_regs.h \
569 linux/tile/arch_sigreturn.c \
570 linux/tile/errnoent1.h \
571 linux/tile/get_error.c \
572 linux/tile/get_scno.c \
573 linux/tile/get_syscall_args.c \
574 linux/tile/ioctls_arch0.h \
575 linux/tile/ioctls_arch1.h \
576 linux/tile/ioctls_inc0.h \
577 linux/tile/ioctls_inc1.h \
578 linux/tile/signalent1.h \
579 linux/tile/syscallent.h \
580 linux/tile/syscallent1.h \
581 linux/tile/userent.h \
586 linux/x32/arch_regs.c \
587 linux/x32/arch_regs.h \
588 linux/x32/arch_sigreturn.c \
589 linux/x32/errnoent1.h \
590 linux/x32/get_error.c \
591 linux/x32/get_scno.c \
592 linux/x32/get_syscall_args.c \
593 linux/x32/ioctls_arch0.h \
594 linux/x32/ioctls_arch1.h \
595 linux/x32/ioctls_inc0.h \
596 linux/x32/ioctls_inc1.h \
597 linux/x32/signalent1.h \
598 linux/x32/syscallent.h \
599 linux/x32/syscallent1.h \
600 linux/x32/userent.h \
601 linux/x86_64/arch_regs.c \
602 linux/x86_64/arch_regs.h \
603 linux/x86_64/arch_sigreturn.c \
604 linux/x86_64/errnoent1.h \
605 linux/x86_64/errnoent2.h \
606 linux/x86_64/gentab.pl \
607 linux/x86_64/get_error.c \
608 linux/x86_64/get_scno.c \
609 linux/x86_64/get_syscall_args.c \
610 linux/x86_64/getregs_old.c \
611 linux/x86_64/ioctls_arch0.h \
612 linux/x86_64/ioctls_arch1.h \
613 linux/x86_64/ioctls_arch2.h \
614 linux/x86_64/ioctls_inc0.h \
615 linux/x86_64/ioctls_inc1.h \
616 linux/x86_64/ioctls_inc2.h \
617 linux/x86_64/signalent1.h \
618 linux/x86_64/signalent2.h \
619 linux/x86_64/syscallent.h \
620 linux/x86_64/syscallent1.h \
621 linux/x86_64/syscallent2.h \
622 linux/x86_64/userent.h \
623 linux/xtensa/arch_regs.c \
624 linux/xtensa/get_error.c \
625 linux/xtensa/get_scno.c \
626 linux/xtensa/get_syscall_args.c \
627 linux/xtensa/get_syscall_result.c \
628 linux/xtensa/ioctls_arch0.h \
629 linux/xtensa/ioctls_inc0.h \
630 linux/xtensa/syscallent.h \
631 linux/xtensa/userent.h \
632 maint/ioctls_gen.sh \
633 maint/ioctls_hex.sh \
634 maint/ioctls_sym.sh \
635 maint/print_ioctlent.c \
645 $(XLAT_INPUT_FILES) \
646 $(XLAT_HEADER_FILES) \
652 rpmbuild --define '%_srcrpmdir .' -ts $(distdir).tar.xz
655 $(AM_V_GEN)echo $(VERSION) > $@-t && mv $@-t $@
658 $(filter %.c,$(strace_SOURCES)) $(filter %.c,$(libstrace_a_SOURCES))
660 sys_func.h: $(patsubst %,$(srcdir)/%,$(strace_SOURCES_c))
662 sed -n 's/^SYS_FUNC(.*/extern &;/p' $$f; \
665 syscallent_names = subcall.h syscallent.h syscallent1.h \
666 syscallent-n32.h syscallent-n64.h syscallent-o32.h
667 syscallent_patterns = $(patsubst %,\%/%,$(syscallent_names))
668 syscallent_files = $(filter $(syscallent_patterns),$(EXTRA_DIST))
670 sen.h: $(patsubst %,$(srcdir)/%,$(syscallent_files))
671 for f in $^; do cat -- $$f; done | \
672 $(srcdir)/generate_sen.sh > $@
675 $(AM_V_GEN)echo $(VERSION) > $(distdir)/.tarball-version
677 today = $(shell date +%Y-%m-%d)
678 version_regexp = $(subst .,\.,$(VERSION))
679 news_check_regexp = 'Noteworthy changes in release $(version_regexp) ($(today))'
682 $(AM_V_GEN)if head -1 $< | \
683 grep -x $(news_check_regexp) >/dev/null; then \
686 echo >&2 '$<: check failed'; \
690 ioctlsort_CC = $(CC_FOR_BUILD)
691 ioctlsort_DEFS = $(DEFS)
692 ioctlsort_INCLUDES = $(DEFAULT_INCLUDES) $(INCLUDES)
693 ioctlsort_CPPFLAGS = $(AM_CPPFLAGS) $(CPPFLAGS_FOR_BUILD)
694 ioctlsort_CFLAGS = $(AM_CFLAGS) $(CFLAGS_FOR_BUILD)
695 ioctlsort_LDFLAGS = $(AM_LDFLAGS) $(LDFLAGS_FOR_BUILD)
697 ioctls_inc_h = $(wildcard $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h)
698 ioctlent_h = $(patsubst $(srcdir)/$(OS)/$(ARCH)/ioctls_inc%,ioctlent%,$(ioctls_inc_h))
699 ioctl_redefs_h = $(filter-out ioctl_redefs0.h,$(subst ioctlent,ioctl_redefs,$(ioctlent_h)))
701 ioctl_redefs%.h: ioctlent%.h ioctlent0.h
703 sort ioctlent0.h | comm -23 $<-t - | \
704 sed -n 's/^{ "\([^"]\+\)", \(0x[[:xdigit:]]\+\) },$$/#ifdef \1\n# undef \1\n# define \1 \2\n#endif/p' \
709 ioctlent%.h: ioctlsort%
712 ioctlsort%$(BUILD_EXEEXT): ioctlsort%.o
713 $(ioctlsort_CC) $(ioctlsort_CFLAGS) $(ioctlsort_LDFLAGS) $< -o $@
715 ioctlsort%.o: ioctls_all%.h $(srcdir)/ioctlsort.c
716 $(ioctlsort_CC) $(ioctlsort_DEFS) $(ioctlsort_INCLUDES) $(ioctlsort_CPPFLAGS) $(ioctlsort_CFLAGS) -DIOCTLSORT_INC=\"$<\" -c -o $@ $(srcdir)/ioctlsort.c
718 ioctls_all%.h: $(srcdir)/$(OS)/$(ARCH)/ioctls_inc%.h $(srcdir)/$(OS)/$(ARCH)/ioctls_arch%.h
721 BUILT_SOURCES = $(ioctl_redefs_h) $(ioctlent_h) \
722 native_printer_decls.h native_printer_defs.h printers.h sen.h sys_func.h .version
723 CLEANFILES = $(ioctl_redefs_h) $(ioctlent_h) $(mpers_preproc_files) \
724 native_printer_decls.h native_printer_defs.h printers.h sen.h sys_func.h
725 DISTCLEANFILES = gnu/stubs-32.h gnu/stubs-x32.h
727 # defines mpers_source_files
729 srcdir_mpers_source_files = $(patsubst %,$(srcdir)/%,$(mpers_source_files))
730 mpers_preproc_files = $(mpers_source_files:.c=.c.mpers.i)
733 mpers_PREFIX = $(mpers_NAME)_
735 mpers_INCLUDES = $(DEFAULT_INCLUDES) $(INCLUDES)
736 mpers_CPPFLAGS = $(strace_CPPFLAGS) $(CPPFLAGS)
737 mpers_sh_opts = $(mpers_DEFS) $(mpers_INCLUDES) $(mpers_CPPFLAGS)
738 libmpers_CPPFLAGS = $(strace_CPPFLAGS) -DIN_MPERS
739 libmpers_CFLAGS = $(strace_CFLAGS)
743 mpers-m%.stamp: $(srcdir_mpers_source_files) | printers.h
745 CC="$(CC)" CFLAGS="$(mpers_sh_opts)" \
746 CPP="$(CPP)" CPPFLAGS="$(mpers_sh_opts) -DIN_MPERS -DMPERS_IS_$(mpers_NAME)" \
747 $(srcdir)/mpers.sh -$(mpers_NAME) $$f || exit; \
751 m%_type_defs.h: $(srcdir_mpers_source_files)
753 sed -n 's/^#include DEF_MPERS_TYPE(\([^)]\+\))/#ifdef MPERS_$(mpers_PREFIX)\1\n# define \1 MPERS_$(mpers_PREFIX)\1\n#endif/p' $$f || exit; \
755 echo '#undef MPERS_PRINTER_NAME' >> $@-t
756 echo '#define MPERS_PRINTER_NAME(printer_name) printer_name' >> $@-t
757 echo '#include "$(mpers_PREFIX)printer_decls.h"' >> $@-t
758 echo '#include MPERS_$(mpers_PREFIX)IOCTL_MACROS' >> $@-t
761 m%_funcs.h: $(srcdir_mpers_source_files)
763 sed -n 's/^SYS_FUNC(\([^)]\+\))/#undef sys_\1\n#define sys_\1 $(mpers_PREFIX)sys_\1/p' $$f || exit; \
765 echo '#include "sys_func.h"' >> $@-t
770 %.c.mpers.i: $(srcdir)/%.c
771 $(CPP) -P $(mpers_sh_opts) -DIN_MPERS_BOOTSTRAP $< -o $@
773 mpers_printer_decl_pattern = ^MPERS_PRINTER_DECL(\([^,)]\+\),[[:space:]]*\([^,)]\+\),[[:space:]]*\([^)]\+\))$$
775 printers.h: $(mpers_preproc_files)
776 echo '/* Generated by Makefile from $^; do not edit. */' > $@-t
777 echo 'typedef struct {' >> $@-t
779 sed -n 's/$(mpers_printer_decl_pattern)/ \1 (*\2)(\3);\n#define \2 MPERS_PRINTER_NAME(\2)\n/p' $$f \
782 echo '} struct_printers;' >> $@-t
783 echo 'extern const struct_printers *printers;' >> $@-t
784 echo '#define MPERS_PRINTER_NAME(printer_name) printers->printer_name' >> $@-t
787 %_printer_decls.h: $(mpers_preproc_files)
788 echo '/* Generated by Makefile from $^; do not edit. */' > $@-t
790 sed -n 's/$(mpers_printer_decl_pattern)/extern \1 $(mpers_PREFIX)\2(\3);/p' $$f \
795 %_printer_defs.h: $(mpers_preproc_files)
796 echo '/* Generated by Makefile from $^; do not edit. */' > $@-t
798 sed -n 's/$(mpers_printer_decl_pattern)/\.\2 = $(mpers_PREFIX)\2,/p' $$f \
803 native_printer_decls.h native_printer_defs.h: mpers_PREFIX =
807 strace_LDADD += libmpers-m32.a
808 noinst_LIBRARIES += libmpers-m32.a
809 libmpers_m32_a_SOURCES = $(mpers_source_files)
810 libmpers_m32_a_CPPFLAGS = $(libmpers_CPPFLAGS) -DMPERS_IS_m32 -I$(builddir)/mpers-m32
811 libmpers_m32_a_CFLAGS = $(libmpers_CFLAGS)
812 mpers_m32_targets = mpers-m32.stamp m32_type_defs.h m32_funcs.h m32_printer_decls.h m32_printer_defs.h
814 BUILT_SOURCES += $(mpers_m32_targets)
815 CLEANFILES += $(mpers_m32_targets)
817 $(mpers_m32_targets): mpers_NAME = m32
819 endif # HAVE_M32_MPERS
823 strace_LDADD += libmpers-mx32.a
824 noinst_LIBRARIES += libmpers-mx32.a
825 libmpers_mx32_a_SOURCES = $(mpers_source_files)
826 libmpers_mx32_a_CPPFLAGS = $(libmpers_CPPFLAGS) -DMPERS_IS_mx32 -I$(builddir)/mpers-mx32
827 libmpers_mx32_a_CFLAGS = $(libmpers_CFLAGS)
828 mpers_mx32_targets = mpers-mx32.stamp mx32_type_defs.h mx32_funcs.h mx32_printer_decls.h mx32_printer_defs.h
830 BUILT_SOURCES += $(mpers_mx32_targets)
831 CLEANFILES += $(mpers_mx32_targets)
833 $(mpers_mx32_targets): mpers_NAME = mx32
835 endif # HAVE_MX32_MPERS
838 -rm -rf mpers-m32 mpers-mx32
842 gen_changelog_start_date = 2009-07-08 20:00
843 $(srcdir)/ChangeLog: $(srcdir)/gitlog-to-changelog $(srcdir)/Makefile.in \
847 ./gitlog-to-changelog --append-dot \
848 --since='$(gen_changelog_start_date)'; \
849 echo; echo; echo 'See ChangeLog-CVS for older changes.' \
854 $(srcdir)/CREDITS: $(srcdir)/CREDITS.in $(srcdir)/.mailmap \
855 $(srcdir)/Makefile.in $(srcdir)/.version
859 sed '/^##/,$$d' CREDITS.in; \
860 { sed -n '1,/^##>/d; s/ \+/\t/; s/^./&/p' CREDITS.in; \
861 git log --pretty=format:'%aN %aE'; \
862 } | LC_ALL=C sort -u \
863 | awk -F'\t' '{printf("\t%s <%s>\n",$$1,$$2)}'; \
864 ) > $@-t && mv $@-t $@
866 export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner --mode=go-w,go+rX