2016-02-19 20:05:58 +00:00
|
|
|
include $(top_rulesdir)/Makefile.inc
|
2011-09-13 15:10:56 +00:00
|
|
|
|
2018-11-11 19:14:08 +00:00
|
|
|
MAKE_PERF := $(MAKE) O=$(CURDIR) prefix=/usr V=1 VF=1 ARCH=$(KERNEL_ARCH) WERROR=0 EXTRA_CFLAGS='$(CFLAGS) $(CPPFLAGS)' LDFLAGS='$(LDFLAGS)'
|
2014-09-27 02:01:14 +00:00
|
|
|
|
|
|
|
# Disable Gtk UI until it's more usable
|
|
|
|
MAKE_PERF += NO_GTK2=1
|
|
|
|
|
2019-01-18 20:01:17 +00:00
|
|
|
# Do not build the unversioned jvmti library
|
|
|
|
MAKE_PERF += feature-jvmti=0
|
|
|
|
|
2014-09-27 02:01:14 +00:00
|
|
|
# Include version in all directory names
|
2018-12-18 17:18:46 +00:00
|
|
|
MAKE_PERF += perfexecdir=lib/perf_$(VERSION)-core plugindir=/usr/lib/traceevent_$(VERSION)/plugins STRACE_GROUPS_DIR=share/perf_$(VERSION)-core/strace/groups tipdir=share/doc/linux-perf-$(VERSION) perf_include_dir=include/perf_$(VERSION) perf_examples_dir=share/doc/linux-perf-$(VERSION)/examples
|
2014-09-27 01:54:29 +00:00
|
|
|
|
|
|
|
# perf can link against libbfd if available, but the result is
|
|
|
|
# undistributable as they are licenced under GPL v2 and v3+
|
|
|
|
# respectively. Override detection of libbfd and insist that
|
|
|
|
# cplus_demangle() can be found in libiberty (LGPL v2.1+).
|
2019-02-25 15:58:41 +00:00
|
|
|
MAKE_PERF += feature-libbfd=0 feature-libbfd-liberty=0 feature-libbfd-liberty-z=0 HAVE_CPLUS_DEMANGLE_SUPPORT=1
|
2011-09-26 11:50:12 +00:00
|
|
|
|
2016-11-04 21:39:04 +00:00
|
|
|
# perf can link against libcrypto if available, but the result is
|
|
|
|
# undistributable as GPL v2 and OpenSSL are not compatible without
|
|
|
|
# an explicit exception. Override detection of libcrypto.
|
|
|
|
MAKE_PERF += NO_LIBCRYPTO=1
|
|
|
|
|
2016-12-21 08:53:24 +00:00
|
|
|
# Currently babeltrace support for `perf data' is not automatically detected.
|
|
|
|
MAKE_PERF += LIBBABELTRACE=1
|
|
|
|
|
2018-07-06 20:34:59 +00:00
|
|
|
# Build with asciidoctor, not asciidoc
|
|
|
|
MAKE_PERF += USE_ASCIIDOCTOR=1
|
|
|
|
|
2018-07-06 21:35:41 +00:00
|
|
|
# Build with Python 3, not Python 2
|
|
|
|
MAKE_PERF += PYTHON=/usr/bin/python3
|
|
|
|
|
2011-09-13 15:10:56 +00:00
|
|
|
all:
|
2014-07-29 19:18:10 +00:00
|
|
|
# perf changes some default directories depending on whether DESTDIR is
|
|
|
|
# set. We must define it even when building to avoid a rebuild when we
|
|
|
|
# run 'make install'.
|
2016-02-19 20:05:58 +00:00
|
|
|
+$(MAKE_PERF) -C $(top_srcdir)/tools/perf -f Makefile.perf all VERSION=$(VERSION) DESTDIR=dummy
|
2016-05-14 23:19:24 +00:00
|
|
|
ifeq (,$(filter nodoc,$(DEB_BUILD_PROFILES)))
|
2016-02-19 20:05:58 +00:00
|
|
|
+$(MAKE_PERF) -C $(top_srcdir)/tools/perf/Documentation man VERSION=$(VERSION)
|
2016-05-14 23:19:24 +00:00
|
|
|
endif
|
2016-11-04 21:39:04 +00:00
|
|
|
# Check that perf didn't get linked against libbfd or libcrypto
|
2014-09-27 01:54:29 +00:00
|
|
|
type ldd
|
2016-11-04 21:39:04 +00:00
|
|
|
! ldd $(CURDIR)/perf | grep -E '\blib(bfd|crypto)'
|
2014-09-27 01:54:29 +00:00
|
|
|
# Check that it includes cplus_demangle from libiberty
|
2016-02-19 20:05:58 +00:00
|
|
|
grep cplus_demangle $(CURDIR)/perf
|
2011-09-26 11:50:12 +00:00
|
|
|
|
|
|
|
install:
|
2016-02-19 20:05:58 +00:00
|
|
|
+$(MAKE_PERF) -C $(top_srcdir)/tools/perf -f Makefile.perf install VERSION=$(VERSION)
|
2014-02-22 23:20:19 +00:00
|
|
|
# Don't install a 'trace' alias yet:
|
|
|
|
# - We need a wrapper for it anyway, so there's little point adding a
|
|
|
|
# versioned link
|
|
|
|
# - It doesn't work out-of-the-box as non-root (it depends on debugfs),
|
|
|
|
# so it's less widely useful than strace
|
|
|
|
# - 'perf trace' doesn't take much more typing
|
|
|
|
rm -f $(DESTDIR)/usr/bin/trace_$(VERSION)
|
2015-09-25 19:04:19 +00:00
|
|
|
mkdir -p $(DESTDIR)/usr/share/bash-completion/
|
|
|
|
mv $(DESTDIR)/etc/bash_completion.d \
|
|
|
|
$(DESTDIR)/usr/share/bash-completion/completions
|
|
|
|
rmdir --ignore-fail-on-non-empty $(DESTDIR)/etc
|
2016-04-28 13:53:34 +00:00
|
|
|
# Check for unversioned files that are likely to result in file conflicts
|
2018-12-18 17:01:34 +00:00
|
|
|
cd $(DESTDIR) && ! find \! -type d \! -path '*[_-]$(VERSION)*' | grep .
|