diff --git a/kernel-tools.spec b/kernel-tools.spec index 6c02582..af720e9 100644 --- a/kernel-tools.spec +++ b/kernel-tools.spec @@ -226,42 +226,49 @@ cd linux-%{kversion} chmod +x tools/perf/check-headers.sh %{perf_make} %{perf_python3} all +%global tools_make \ + make CFLAGS="${RPM_OPT_FLAGS}" LDFLAGS="%{__global_ldflags}" HOSTCFLAGS="%{?build_hostcflags}" HOSTLDFLAGS="%{?build_hostldflags}" V=1 + # cpupower # make sure version-gen.sh is executable. chmod +x tools/power/cpupower/utils/version-gen.sh -make %{?_smp_mflags} -C tools/power/cpupower CPUFREQ_BENCH=false +%{tools_make} %{?_smp_mflags} -C tools/power/cpupower CPUFREQ_BENCH=false %ifarch %{ix86} pushd tools/power/cpupower/debug/i386 - make %{?_smp_mflags} centrino-decode powernow-k8-decode + %{tools_make} %{?_smp_mflags} centrino-decode powernow-k8-decode popd %endif %ifarch x86_64 pushd tools/power/cpupower/debug/x86_64 - make %{?_smp_mflags} centrino-decode powernow-k8-decode + %{tools_make} %{?_smp_mflags} centrino-decode powernow-k8-decode popd %endif %ifarch %{ix86} x86_64 pushd tools/power/x86/x86_energy_perf_policy/ - make + %{tools_make} popd pushd tools/power/x86/turbostat - make + %{tools_make} popd %endif #turbostat/x86_energy_perf_policy pushd tools/thermal/tmon/ -make +%{tools_make} popd pushd tools/iio/ -make +%{tools_make} popd pushd tools/gpio/ -make +%{tools_make} popd + +%global bpftool_make \ + make EXTRA_CFLAGS="${RPM_OPT_FLAGS}" EXTRA_LDFLAGS="%{__global_ldflags}" DESTDIR=$RPM_BUILD_ROOT V=1 + pushd tools/bpf/bpftool -make +%{bpftool_make} popd pushd tools/lib/bpf -make V=1 +%{tools_make} V=1 popd # Build the docs @@ -325,31 +332,31 @@ install -m644 %{SOURCE2001} %{buildroot}%{_sysconfdir}/sysconfig/cpupower %ifarch %{ix86} x86_64 mkdir -p %{buildroot}%{_mandir}/man8 pushd tools/power/x86/x86_energy_perf_policy - make DESTDIR=%{buildroot} install + %{tools_make} DESTDIR=%{buildroot} install popd pushd tools/power/x86/turbostat - make DESTDIR=%{buildroot} install + %{tools_make} DESTDIR=%{buildroot} install popd %endif #turbostat/x86_energy_perf_policy pushd tools/thermal/tmon -make INSTALL_ROOT=%{buildroot} install +%{tools_make} INSTALL_ROOT=%{buildroot} install popd pushd tools/iio -make DESTDIR=%{buildroot} install +%{tools_make} DESTDIR=%{buildroot} install popd pushd tools/gpio -make DESTDIR=%{buildroot} install +%{tools_make} DESTDIR=%{buildroot} install popd pushd tools/kvm/kvm_stat -make INSTALL_ROOT=%{buildroot} install-tools +%{tools_make} INSTALL_ROOT=%{buildroot} install-tools popd pushd tools/bpf/bpftool -make DESTDIR=%{buildroot} prefix=%{_prefix} bash_compdir=%{_sysconfdir}/bash_completion.d/ mandir=%{_mandir} install doc-install +%{bpftool_make} prefix=%{_prefix} bash_compdir=%{_sysconfdir}/bash_completion.d/ mandir=%{_mandir} install doc-install # man-pages packages this (rhbz #1686954) rm %{buildroot}%{_mandir}/man7/bpf-helpers.7 popd pushd tools/lib/bpf -make DESTDIR=%{buildroot} prefix=%{_prefix} libdir=%{_libdir} V=1 install install_headers +%{tools_make} DESTDIR=%{buildroot} prefix=%{_prefix} libdir=%{_libdir} V=1 install install_headers popd ###