diff options
Diffstat (limited to '')
-rw-r--r-- | debian/rules.d/tools/bpf/bpftool/Makefile | 27 | ||||
-rw-r--r-- | debian/rules.d/tools/hv/Makefile | 17 | ||||
-rw-r--r-- | debian/rules.d/tools/objtool/Makefile | 18 | ||||
-rw-r--r-- | debian/rules.d/tools/objtool/objtool.c | 21 | ||||
-rw-r--r-- | debian/rules.d/tools/perf/Makefile | 70 | ||||
-rw-r--r-- | debian/rules.d/tools/power/cpupower/Makefile | 26 | ||||
-rw-r--r-- | debian/rules.d/tools/power/x86/Makefile | 5 | ||||
-rw-r--r-- | debian/rules.d/tools/power/x86/turbostat/Makefile | 9 | ||||
-rw-r--r-- | debian/rules.d/tools/power/x86/x86_energy_perf_policy/Makefile | 7 | ||||
-rw-r--r-- | debian/rules.d/tools/tracing/rtla/Makefile | 17 | ||||
-rw-r--r-- | debian/rules.d/tools/usb/usbip/Makefile | 31 |
11 files changed, 248 insertions, 0 deletions
diff --git a/debian/rules.d/tools/bpf/bpftool/Makefile b/debian/rules.d/tools/bpf/bpftool/Makefile new file mode 100644 index 0000000000..17c27c1044 --- /dev/null +++ b/debian/rules.d/tools/bpf/bpftool/Makefile @@ -0,0 +1,27 @@ +include $(top_rulesdir)/Makefile.inc + +MAKE_BPFTOOL := +$(MAKE) -C $(top_srcdir)/$(OUTDIR) O=$(CURDIR) +MAKE_BPFTOOL += prefix=/usr +MAKE_BPFTOOL += mandir=/usr/share/man +MAKE_BPFTOOL += V=1 +MAKE_BPFTOOL += ARCH=$(KERNEL_ARCH) +MAKE_BPFTOOL += EXTRA_CFLAGS='$(CFLAGS) $(CPPFLAGS)' +MAKE_BPFTOOL += EXTRA_LDFLAGS='$(LDFLAGS)' + +# dynamically linking with libbfd is not allowed in Debian +MAKE_BPFTOOL += feature-libbfd=0 feature-libbfd-liberty=0 feature-libbfd-liberty-z=0 + +all: + $(MAKE_BPFTOOL) +ifeq (,$(filter nodoc,$(DEB_BUILD_PROFILES))) + $(MAKE_BPFTOOL) doc +endif +# Check that bpftool wasn't linked with libbfd + type ldd + ! ldd $(CURDIR)/bpftool | grep -E '\blibbfd' + +install: + $(MAKE_BPFTOOL) install +ifeq (,$(filter nodoc,$(DEB_BUILD_PROFILES))) + $(MAKE_BPFTOOL) doc-install +endif diff --git a/debian/rules.d/tools/hv/Makefile b/debian/rules.d/tools/hv/Makefile new file mode 100644 index 0000000000..5f00f55136 --- /dev/null +++ b/debian/rules.d/tools/hv/Makefile @@ -0,0 +1,17 @@ +ifeq ($(filter i386 amd64 x32 arm64,$(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/objtool/Makefile b/debian/rules.d/tools/objtool/Makefile new file mode 100644 index 0000000000..8666355f6e --- /dev/null +++ b/debian/rules.d/tools/objtool/Makefile @@ -0,0 +1,18 @@ +PROGS = \ + objtool \ + objtool.real-powerpc \ + objtool.real-x86 + +include $(top_rulesdir)/Makefile.inc + +objtool.real-%: + mkdir -p $* +# objtool always uses HOSTCC, HOSTLD, and HOSTAR; we need to override +# these on the command line to make cross-builds work. But it also +# builds fixdep which still needs to be native in a cross-build. Set +# REALHOSTCC and REALHOSTLD variables which will be used for fixdep. + $(MAKE) -C $(top_srcdir)/tools/objtool O=$(CURDIR)/$* HOSTARCH=$(KERNEL_ARCH) ARCH=$* HOSTCC=$(CC) HOSTLD=$(CROSS_COMPILE)ld HOSTAR=$(CROSS_COMPILE)ar REALHOSTCC=gcc REALHOSTLD=ld V=1 EXTRA_CFLAGS='$(CFLAGS) $(CPPFLAGS)' + ln -f $*/objtool $@ + +%: %.o + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ diff --git a/debian/rules.d/tools/objtool/objtool.c b/debian/rules.d/tools/objtool/objtool.c new file mode 100644 index 0000000000..beb42c631f --- /dev/null +++ b/debian/rules.d/tools/objtool/objtool.c @@ -0,0 +1,21 @@ +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> + +int main(int argc, char **argv) +{ + const char *arch; + char prog[1024]; + + arch = getenv("SRCARCH"); + if (!arch) { + fprintf(stderr, "objtool: SRCARCH variable not defined\n"); + return 2; + } + + snprintf(prog, sizeof(prog), "%s.real-%s", argv[0], arch); + execv(prog, argv); + + fprintf(stderr, "objtool: Failed to execute %s\n", prog); + return 1; +} diff --git a/debian/rules.d/tools/perf/Makefile b/debian/rules.d/tools/perf/Makefile new file mode 100644 index 0000000000..910f03776f --- /dev/null +++ b/debian/rules.d/tools/perf/Makefile @@ -0,0 +1,70 @@ +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)' EXTRA_CXXFLAGS='$(CXXFLAGS) $(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 + +MAKE_PERF += 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 + +# perf can link against libdebuginfod if available, but the result is +# undistributable for the same reason. Override detection of +# libdebuginfod. +MAKE_PERF += NO_LIBDEBUGINFOD=1 + +# perf can link against libcrypto if available, but the result is +# undistributable as GPL v2 and Apache 2.0 are not compatible without +# an explicit exception. Override detection of libcrypto. +MAKE_PERF += NO_LIBCRYPTO=1 + +# perf only links against libopencsd (coresight) if specifically enabled +MAKE_PERF += CORESIGHT=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 + +# Ensure the right options are picked up for libperl and libpython +export PERL5LIB=/usr/lib/$(DEB_HOST_MULTIARCH)/perl/cross-config +MAKE_PERF += PYTHON_CONFIG=$(CROSS_COMPILE)python3-config + +# Explicitly set DEBUG=0. This is the default for perf itself, but +# it's not passed down to libapi and it uses the wrong compiler +# options unless it's explicitly set. +MAKE_PERF += DEBUG=0 + +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 DESTDIR=dummy +ifeq (,$(filter nodoc,$(DEB_BUILD_PROFILES))) + +$(MAKE_PERF) -C $(top_srcdir)/tools/perf/Documentation man +endif +# Check that perf didn't get linked against incompatibly-licensed libraries + type ldd + ! ldd $(CURDIR)/perf | grep -E '\blib(bfd|crypto|debuginfod)' +# Check that it links against abi::__cxa_demangle from libstdc++ + grep __cxa_demangle $(CURDIR)/perf + +install: + +$(MAKE_PERF) -C $(top_srcdir)/tools/perf -f Makefile.perf install install-python_ext +# 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 + 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 diff --git a/debian/rules.d/tools/power/cpupower/Makefile b/debian/rules.d/tools/power/cpupower/Makefile new file mode 100644 index 0000000000..e4bd5202da --- /dev/null +++ b/debian/rules.d/tools/power/cpupower/Makefile @@ -0,0 +1,26 @@ +include $(top_rulesdir)/Makefile.inc + +MAKE_CPUPOWER := CFLAGS='$(CFLAGS) $(CPPFLAGS)' LDFLAGS='$(LDFLAGS)' $(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 0000000000..2b9d7735c7 --- /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 0000000000..eb5124d3a5 --- /dev/null +++ b/debian/rules.d/tools/power/x86/turbostat/Makefile @@ -0,0 +1,9 @@ +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"' + +LDLIBS += -lcap -lrt 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 0000000000..b9ec56c89c --- /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/tracing/rtla/Makefile b/debian/rules.d/tools/tracing/rtla/Makefile new file mode 100644 index 0000000000..9dd1cfd416 --- /dev/null +++ b/debian/rules.d/tools/tracing/rtla/Makefile @@ -0,0 +1,17 @@ +include $(top_rulesdir)/Makefile.inc + +all: +# Out-of-tree build is not supported, so copy source to the build dir + echo '$(UPSTREAMVERSION)' >VERSION + rsync -a $(top_srcdir)/tools/tracing/rtla/ . + rsync -a $(top_srcdir)/Documentation/tools/rtla/ Documentation/ + $(MAKE) EXTRA_CFLAGS='$(CFLAGS) $(CPPFLAGS)' EXTRA_LDFLAGS='$(LDFLAGS)' PKG_CONFIG='$(PKG_CONFIG)' + +install: + $(MAKE) install +ifneq (,$(filter nodoc,$(DEB_BUILD_PROFILES))) + rm -rf $(DESTDIR)/usr/share/man +endif + +clean: + rm -rf * diff --git a/debian/rules.d/tools/usb/usbip/Makefile b/debian/rules.d/tools/usb/usbip/Makefile new file mode 100644 index 0000000000..5a2cbdb5d7 --- /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 CPPFLAGS) \ + -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=1 + +install: + $(MAKE) V=1 install +ifneq (,$(filter nodoc,$(DEB_BUILD_PROFILES))) + rm -rf $(DESTDIR)/usr/share/man +endif + +clean: + rm -rf * |