]> granicus.if.org Git - strace/blobdiff - Makefile.am
bpf: move common code to a separate function
[strace] / Makefile.am
index 39af5d1d8451a19956fe92044c82579ad3abc73a..9b00481da6d4f966880bb07a23c623e733098199 100644 (file)
@@ -53,6 +53,9 @@ AM_CPPFLAGS = -I$(builddir)/$(OS)/$(ARCH) \
              -I$(builddir) \
              -I$(srcdir)
 
+AM_CFLAGS_FOR_BUILD = $(WARN_CFLAGS_FOR_BUILD)
+AM_CPPFLAGS_FOR_BUILD = $(AM_CPPFLAGS)
+
 include xlat/Makemodule.am
 
 strace_CPPFLAGS = $(AM_CPPFLAGS)
@@ -167,6 +170,7 @@ strace_SOURCES =    \
        native_defs.h   \
        net.c           \
        netlink.c       \
+       nsig.h          \
        numa.c          \
        oldstat.c       \
        open.c          \
@@ -178,8 +182,10 @@ strace_SOURCES =   \
        pkeys.c         \
        poll.c          \
        prctl.c         \
+       print_dev_t.c   \
        print_mq_attr.c \
        print_msgbuf.c  \
+       print_sg_req_info.c \
        print_sigevent.c \
        print_statfs.c  \
        print_struct_stat.c \
@@ -209,6 +215,8 @@ strace_SOURCES =    \
        seccomp.c       \
        seccomp_fprog.h \
        sendfile.c      \
+       sg_io_v3.c      \
+       sg_io_v4.c      \
        sigaltstack.c   \
        sigevent.h      \
        signal.c        \
@@ -227,6 +235,7 @@ strace_SOURCES =    \
        swapon.c        \
        syscall.c       \
        sysctl.c        \
+       sysent.h        \
        sysinfo.c       \
        syslog.c        \
        sysmips.c       \
@@ -241,11 +250,11 @@ strace_SOURCES =  \
        umount.c        \
        uname.c         \
        userfaultfd.c   \
+       ustat.c         \
        util.c          \
        utime.c         \
        utimes.c        \
        v4l2.c          \
-       vsprintf.c      \
        wait.c          \
        xattr.c         \
        xlat.h          \
@@ -295,6 +304,7 @@ EXTRA_DIST =                                \
        debian/watch                    \
        errnoent.sh                     \
        generate_sen.sh                 \
+       ioctl_iocdef.c                  \
        ioctlsort.c                     \
        linux/32/ioctls_inc.h           \
        linux/32/ioctls_inc_align16.h   \
@@ -740,6 +750,7 @@ EXTRA_DIST =                                \
        mpers.sh                        \
        mpers_test.sh                   \
        mpers_xlat.h                    \
+       scno.head                       \
        signalent.sh                    \
        strace-graph                    \
        strace-log-merge                \
@@ -750,6 +761,9 @@ EXTRA_DIST =                                \
        xlat/gen.sh                     \
        xlate.el
 
+.PHONY: check-valgrind-local
+check-valgrind-local:
+
 .PHONY: srpm
 srpm: dist-xz
        rpmbuild --define '%_srcrpmdir .' -ts $(distdir).tar.xz
@@ -793,9 +807,9 @@ news-check: NEWS
 ioctlsort_CC = $(CC_FOR_BUILD)
 ioctlsort_DEFS = $(DEFS)
 ioctlsort_INCLUDES = $(DEFAULT_INCLUDES) $(INCLUDES)
-ioctlsort_CPPFLAGS = $(AM_CPPFLAGS) $(CPPFLAGS_FOR_BUILD)
-ioctlsort_CFLAGS = $(AM_CFLAGS) $(CFLAGS_FOR_BUILD)
-ioctlsort_LDFLAGS = $(AM_LDFLAGS) $(LDFLAGS_FOR_BUILD)
+ioctlsort_CPPFLAGS = $(AM_CPPFLAGS_FOR_BUILD) $(CPPFLAGS_FOR_BUILD)
+ioctlsort_CFLAGS = $(AM_CFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD)
+ioctlsort_LDFLAGS = $(AM_LDFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD)
 
 ioctls_inc_h = $(wildcard $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h)
 ioctlent_h = $(patsubst $(srcdir)/$(OS)/$(ARCH)/ioctls_inc%,ioctlent%,$(ioctls_inc_h))
@@ -812,10 +826,19 @@ ioctl_redefs%.h: ioctlent%.h ioctlent0.h
 ioctlent%.h: ioctlsort%
        ./$< > $@
 
+# Need to pick up <linux/ioctl.h> definitions *for host* while compiling
+# ioctlsort *for build*, hence this magic.
+ioctl_iocdef.i: $(srcdir)/ioctl_iocdef.c
+       $(CPP) -P $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+               $(strace_CPPFLAGS) $(CPPFLAGS) $< -o $@
+
+ioctl_iocdef.h: ioctl_iocdef.i
+       sed -n 's/^DEFINE HOST/#define /p' $< > $@
+
 ioctlsort%$(BUILD_EXEEXT): ioctlsort%.o
        $(ioctlsort_CC) $(ioctlsort_CFLAGS) $(ioctlsort_LDFLAGS) $< -o $@
 
-ioctlsort%.o: ioctls_all%.h $(srcdir)/ioctlsort.c
+ioctlsort%.o: ioctls_all%.h ioctl_iocdef.h $(srcdir)/ioctlsort.c
        $(ioctlsort_CC) $(ioctlsort_DEFS) $(ioctlsort_INCLUDES) $(ioctlsort_CPPFLAGS) $(ioctlsort_CFLAGS) -DIOCTLSORT_INC=\"$<\" -c -o $@ $(srcdir)/ioctlsort.c
 
 ioctls_all%.h: $(srcdir)/$(OS)/$(ARCH)/ioctls_inc%.h $(srcdir)/$(OS)/$(ARCH)/ioctls_arch%.h
@@ -824,9 +847,14 @@ ioctls_all%.h: $(srcdir)/$(OS)/$(ARCH)/ioctls_inc%.h $(srcdir)/$(OS)/$(ARCH)/ioc
 BUILT_SOURCES = $(ioctl_redefs_h) $(ioctlent_h) \
                native_printer_decls.h native_printer_defs.h printers.h sen.h sys_func.h .version
 CLEANFILES    = $(ioctl_redefs_h) $(ioctlent_h) $(mpers_preproc_files) \
+               ioctl_iocdef.h ioctl_iocdef.i \
                native_printer_decls.h native_printer_defs.h printers.h sen.h sys_func.h
 DISTCLEANFILES = gnu/stubs-32.h gnu/stubs-x32.h
 
+include scno.am
+
+$(strace_OBJECTS): scno.h
+
 # defines mpers_source_files
 include mpers.am
 srcdir_mpers_source_files = $(patsubst %,$(srcdir)/%,$(mpers_source_files))
@@ -853,7 +881,7 @@ mpers-m%.stamp: $(srcdir_mpers_source_files) | printers.h
 
 m%_type_defs.h: $(srcdir_mpers_source_files)
        for f in $^; do \
-               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; \
+               sed -r -n 's/^#[[:space:]]*include DEF_MPERS_TYPE\(([^)]+)\)/#ifdef MPERS_$(mpers_PREFIX)\1\n# define \1 MPERS_$(mpers_PREFIX)\1\n#endif/p' $$f || exit; \
        done > $@-t
        echo '#undef MPERS_PRINTER_NAME' >> $@-t
        echo '#define MPERS_PRINTER_NAME(printer_name) printer_name' >> $@-t