summaryrefslogtreecommitdiffstats
path: root/debian/rules.d/tools
diff options
context:
space:
mode:
Diffstat (limited to 'debian/rules.d/tools')
-rw-r--r--debian/rules.d/tools/hv/Makefile17
-rw-r--r--debian/rules.d/tools/lib/bpf/Makefile17
-rw-r--r--debian/rules.d/tools/objtool/Makefile11
-rw-r--r--debian/rules.d/tools/perf/Makefile62
-rw-r--r--debian/rules.d/tools/power/cpupower/Makefile26
-rw-r--r--debian/rules.d/tools/power/x86/Makefile5
-rw-r--r--debian/rules.d/tools/power/x86/turbostat/Makefile7
-rw-r--r--debian/rules.d/tools/power/x86/x86_energy_perf_policy/Makefile7
-rw-r--r--debian/rules.d/tools/usb/usbip/Makefile31
9 files changed, 183 insertions, 0 deletions
diff --git a/debian/rules.d/tools/hv/Makefile b/debian/rules.d/tools/hv/Makefile
new file mode 100644
index 000000000..8c563673b
--- /dev/null
+++ b/debian/rules.d/tools/hv/Makefile
@@ -0,0 +1,17 @@
+ifeq ($(filter i386 amd64 x32,$(DEB_HOST_ARCH)),)
+
+# Build nothing
+include $(top_rulesdir)/Makefile.inc
+
+else
+
+PROGS = \
+ hv_fcopy_daemon \
+ hv_kvp_daemon \
+ hv_vss_daemon
+
+installdir = /usr/sbin
+
+include $(top_rulesdir)/Makefile.inc
+
+endif
diff --git a/debian/rules.d/tools/lib/bpf/Makefile b/debian/rules.d/tools/lib/bpf/Makefile
new file mode 100644
index 000000000..bc454045d
--- /dev/null
+++ b/debian/rules.d/tools/lib/bpf/Makefile
@@ -0,0 +1,17 @@
+include $(top_rulesdir)/Makefile.inc
+
+DEB_HOST_MULTIARCH := $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
+
+# Catch use of missing kernel APIs early
+CFLAGS += -Werror=implicit-function-declaration
+
+MAKE_BPF := +$(MAKE) -C $(top_srcdir)/$(OUTDIR) O=$(CURDIR)
+MAKE_BPF += prefix=/usr
+MAKE_BPF += libdir_relative=lib/$(DEB_HOST_MULTIARCH)
+MAKE_BPF += V=$(KBUILD_VERBOSE)
+
+all:
+ $(MAKE_BPF)
+
+install:
+ $(MAKE_BPF) install install_headers
diff --git a/debian/rules.d/tools/objtool/Makefile b/debian/rules.d/tools/objtool/Makefile
new file mode 100644
index 000000000..9990cde31
--- /dev/null
+++ b/debian/rules.d/tools/objtool/Makefile
@@ -0,0 +1,11 @@
+include $(top_rulesdir)/Makefile.inc
+
+all:
+# For now, only supported target architecture is x86. Later we'll need to build
+# for multiple targets and add a wrapper, same as for modpost.
+# objtool explicitly sets CC and LD to be native tools; we need to override
+# this on the command line to make cross-builds work.
+ $(MAKE) -C $(top_srcdir)/tools/objtool O=$(CURDIR) HOSTARCH=$(KERNEL_ARCH) ARCH=x86 CC=$(CC) LD=$(CROSS_COMPILE)ld V=$(KBUILD_VERBOSE)
+
+install:
+ install -D -m755 objtool $(DESTDIR)/$(installdir)/objtool
diff --git a/debian/rules.d/tools/perf/Makefile b/debian/rules.d/tools/perf/Makefile
new file mode 100644
index 000000000..3c397c75e
--- /dev/null
+++ b/debian/rules.d/tools/perf/Makefile
@@ -0,0 +1,62 @@
+include $(top_rulesdir)/Makefile.inc
+
+MAKE_PERF := $(MAKE) O=$(CURDIR) prefix=/usr V=1 VF=1 ARCH=$(KERNEL_ARCH) WERROR=0 EXTRA_CFLAGS='$(CFLAGS) $(CPPFLAGS)' LDFLAGS='$(LDFLAGS)'
+
+# Disable Gtk UI until it's more usable
+MAKE_PERF += NO_GTK2=1
+
+# Do not build the unversioned jvmti library
+MAKE_PERF += feature-jvmti=0
+
+# Include version in all directory names
+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
+
+# 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+).
+MAKE_PERF += feature-libbfd=0 feature-libbfd-liberty=0 feature-libbfd-liberty-z=0 HAVE_CPLUS_DEMANGLE_SUPPORT=1
+
+# 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
+
+# Currently babeltrace support for `perf data' is not automatically detected.
+MAKE_PERF += LIBBABELTRACE=1
+
+# Build with asciidoctor, not asciidoc
+MAKE_PERF += USE_ASCIIDOCTOR=1
+
+# Build with Python 3, not Python 2
+MAKE_PERF += PYTHON=/usr/bin/python3
+
+all:
+# 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'.
+ +$(MAKE_PERF) -C $(top_srcdir)/tools/perf -f Makefile.perf all VERSION=$(VERSION) DESTDIR=dummy
+ifeq (,$(filter nodoc,$(DEB_BUILD_PROFILES)))
+ +$(MAKE_PERF) -C $(top_srcdir)/tools/perf/Documentation man VERSION=$(VERSION)
+endif
+# Check that perf didn't get linked against libbfd or libcrypto
+ type ldd
+ ! ldd $(CURDIR)/perf | grep -E '\blib(bfd|crypto)'
+# Check that it includes cplus_demangle from libiberty
+ grep cplus_demangle $(CURDIR)/perf
+
+install:
+ +$(MAKE_PERF) -C $(top_srcdir)/tools/perf -f Makefile.perf install VERSION=$(VERSION)
+# 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)
+ 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
+# Check for unversioned files that are likely to result in file conflicts
+ cd $(DESTDIR) && ! find \! -type d \! -path '*[_-]$(VERSION)*' | grep .
diff --git a/debian/rules.d/tools/power/cpupower/Makefile b/debian/rules.d/tools/power/cpupower/Makefile
new file mode 100644
index 000000000..c43bd62f1
--- /dev/null
+++ b/debian/rules.d/tools/power/cpupower/Makefile
@@ -0,0 +1,26 @@
+include $(top_rulesdir)/Makefile.inc
+
+MAKE_CPUPOWER := $(shell dpkg-buildflags --export=cmdline) $(MAKE) O=$(CURDIR) CPUFREQ_BENCH=false V=true mandir=/usr/share/man
+
+MAKE_CPUPOWER += DEBUG=$(if $(filter noopt,$(DEB_BUILD_OPTIONS)),true,)
+
+# Don't strip binaries here; let dh_strip determine what to do
+MAKE_CPUPOWER += STRIP=true
+
+MAKE_CPUPOWER += CROSS='$(CROSS_COMPILE)'
+
+MAKE_CPUPOWER += PACKAGE_BUGREPORT='Debian\ \(reportbug\ linux-cpupower\)'
+
+MAKE_CPUPOWER += libdir=/usr/lib/$(DEB_HOST_MULTIARCH)
+
+all:
+ +$(MAKE_CPUPOWER) -C $(top_srcdir)/tools/power/cpupower
+
+install:
+ +$(MAKE_CPUPOWER) -C $(top_srcdir)/tools/power/cpupower install DESTDIR=$(DESTDIR)
+ifneq (,$(filter nodoc,$(DEB_BUILD_PROFILES)))
+ rm -rf $(DESTDIR)/usr/share/man
+endif
+
+clean:
+ +$(MAKE_CPUPOWER) -C $(top_srcdir)/tools/power/cpupower clean
diff --git a/debian/rules.d/tools/power/x86/Makefile b/debian/rules.d/tools/power/x86/Makefile
new file mode 100644
index 000000000..2b9d7735c
--- /dev/null
+++ b/debian/rules.d/tools/power/x86/Makefile
@@ -0,0 +1,5 @@
+SUBDIRS = \
+ turbostat \
+ x86_energy_perf_policy
+
+include $(top_rulesdir)/Makefile.inc
diff --git a/debian/rules.d/tools/power/x86/turbostat/Makefile b/debian/rules.d/tools/power/x86/turbostat/Makefile
new file mode 100644
index 000000000..4c4ed2cdf
--- /dev/null
+++ b/debian/rules.d/tools/power/x86/turbostat/Makefile
@@ -0,0 +1,7 @@
+PROGS = turbostat
+
+installdir = /usr/sbin
+
+include $(top_rulesdir)/Makefile.inc
+
+CPPFLAGS += -I"$(top_srcdir)/tools/include" -DMSRHEADER='"$(top_srcdir)/arch/x86/include/asm/msr-index.h"' -DINTEL_FAMILY_HEADER='"$(top_srcdir)/arch/x86/include/asm/intel-family.h"'
diff --git a/debian/rules.d/tools/power/x86/x86_energy_perf_policy/Makefile b/debian/rules.d/tools/power/x86/x86_energy_perf_policy/Makefile
new file mode 100644
index 000000000..b9ec56c89
--- /dev/null
+++ b/debian/rules.d/tools/power/x86/x86_energy_perf_policy/Makefile
@@ -0,0 +1,7 @@
+PROGS = x86_energy_perf_policy
+
+installdir = /usr/sbin
+
+include $(top_rulesdir)/Makefile.inc
+
+CPPFLAGS += -I"$(top_srcdir)/tools/include" -DMSRHEADER='"$(top_srcdir)/arch/x86/include/asm/msr-index.h"'
diff --git a/debian/rules.d/tools/usb/usbip/Makefile b/debian/rules.d/tools/usb/usbip/Makefile
new file mode 100644
index 000000000..3decaac98
--- /dev/null
+++ b/debian/rules.d/tools/usb/usbip/Makefile
@@ -0,0 +1,31 @@
+srcdir := $(top_srcdir)/tools/usb/usbip
+
+# Make sure we don't override top_srcdir in the sub-make. 'unexport
+# top_srcdir' is *not* sufficient; nor is adding 'MAKEFLAGS=' to the
+# sub-make command line.
+unexport MAKEFLAGS
+
+all: export CFLAGS := $(shell dpkg-buildflags --get CFLAGS)
+all: export CPPFLAGS := $(shell dpkg-buildflags --get CFLAGS) \
+ -isystem $(top_srcdir)/debian/build/build-tools/include
+all: export LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS)
+all:
+ rsync -a $(srcdir)/ .
+ ./autogen.sh
+ ./configure \
+ --prefix=/usr \
+ --with-tcp-wrappers \
+ --with-usbids-dir=/usr/share/misc \
+ --disable-shared \
+ --disable-static \
+ --host=$(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+ $(MAKE) V=$(KBUILD_VERBOSE)
+
+install:
+ $(MAKE) V=$(KBUILD_VERBOSE) install
+ifneq (,$(filter nodoc,$(DEB_BUILD_PROFILES)))
+ rm -rf $(DESTDIR)/usr/share/man
+endif
+
+clean:
+ rm -rf *