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