Debian Codegraph @

debian/rules.d/tools/perf/Makefile

raw symbols SCIP
1 include $(top_rulesdir)/Makefile.inc
2
3 # gas only understands the -fdebug-prefix-map option, and gcc doesn't
4 # convert the -ffile-prefix-map option to that when invoking gas. So
5 # use both options.
6 ifneq ($(filter -ffile-prefix-map=%,$(CFLAGS)),)
7 CFLAGS += -fdebug-prefix-map=$(DEB_BUILD_PATH)=.
8 endif
9
10 MAKE_UPSTREAM += VF=1 WERROR=0
11
12 # Disable Gtk UI until it's more usable
13 MAKE_UPSTREAM += NO_GTK2=1
14
15 # Do not build the unversioned jvmti library
16 MAKE_UPSTREAM += feature-jvmti=0
17
18 MAKE_UPSTREAM += perfexecdir=lib/perf-core plugindir=/usr/lib/traceevent/plugins tipdir=share/doc/linux-perf perf_include_dir=include/perf perf_examples_dir=share/doc/linux-perf/examples
19
20 # perf can link against libcrypto if available, but the result is
21 # undistributable as GPL v2 and Apache 2.0 are not compatible without
22 # an explicit exception. Override detection of libcrypto.
23 MAKE_UPSTREAM += NO_LIBCRYPTO=1
24
25 # perf only links against libopencsd (coresight) if specifically enabled
26 MAKE_UPSTREAM += CORESIGHT=1
27
28 # Currently babeltrace support for `perf data' is not automatically detected.
29 MAKE_UPSTREAM += LIBBABELTRACE=1
30
31 # Build with asciidoctor, not asciidoc
32 MAKE_UPSTREAM += USE_ASCIIDOCTOR=1
33
34 # Build with Python 3, not Python 2
35 MAKE_UPSTREAM += PYTHON=/usr/bin/python3
36
37 # Ensure the right options are picked up for libperl and libpython
38 export PERL5LIB=/usr/lib/$(DEB_HOST_MULTIARCH)/perl/cross-config
39 MAKE_UPSTREAM += PYTHON_CONFIG=$(CROSS_COMPILE)python3-config
40
41 # Explicitly set DEBUG=0. This is the default for perf itself, but
42 # it's not passed down to libapi and it uses the wrong compiler
43 # options unless it's explicitly set.
44 MAKE_UPSTREAM += DEBUG=0
45
46 # Disable Rust support, currently only a test case. The target name
47 # mapping in Makefile.config is wrong for some Debian architectures
48 # and not worth fixing just for a test.
49 MAKE_UPSTREAM += NO_RUST=1
50
51 all:
52 $(MAKE_UPSTREAM) -f Makefile.perf all
53 ifeq (,$(filter nodoc,$(DEB_BUILD_PROFILES)))
54 $(MAKE_UPSTREAM) -C $(srcdir)/Documentation man
55 endif
56 # Check that perf didn't get linked against incompatibly-licensed libraries
57 @if readelf -d $(CURDIR)/perf | sed -rne 's/.*NEEDED.*\[(.*)\]/\1/p' | grep -E '\blib(bfd|crypto)'; then \
58 echo; \
59 echo 'perf linked against incompatibly-licensed libraries'; \
60 echo; \
61 exit 1; \
62 fi
63 # Check that it links against abi::__cxa_demangle from libstdc++
64 grep __cxa_demangle $(CURDIR)/perf
65
66 install:
67 $(MAKE_UPSTREAM) -f Makefile.perf install install-python_ext
68 # Don't install a 'trace' alias yet:
69 # - We need a wrapper for it anyway, so there's little point adding a
70 # versioned link
71 # - It doesn't work out-of-the-box as non-root (it depends on debugfs),
72 # so it's less widely useful than strace
73 # - 'perf trace' doesn't take much more typing
74 rm -f $(DESTDIR)/usr/bin/trace
75 mkdir -p $(DESTDIR)/usr/share/bash-completion/
76 mv $(DESTDIR)/etc/bash_completion.d \
77 $(DESTDIR)/usr/share/bash-completion/completions
78 rmdir --ignore-fail-on-non-empty $(DESTDIR)/etc