Add ccache switch, useful for local rebuilds

This commit is contained in:
Mikhail Novosyolov 2020-07-27 16:53:12 +03:00
parent 2812a67ad1
commit ed3d48040b

View file

@ -85,6 +85,8 @@
%bcond_with binary_extra_modules
%endif
%bcond_with ccache
# Kernel flavour
%if %{with nickel}
%define flavour nickel
@ -175,11 +177,13 @@
%define debug_package %{nil}
%endif
%if %(if [ -z "$CC" ] ; then echo 0; else echo 1; fi)
%define kmake %make CC="$CC"
# http://nickdesaulniers.github.io/blog/2018/06/02/speeding-up-linux-kernel-builds-with-ccache/
%if %{with ccache}
%define kmake KBUILD_BUILD_TIMESTAMP='' %make CC='ccache gcc'
%else
%define kmake %make
%define kmake %make CC='gcc'
%endif
# there are places where parallel make don't work
%define smake make
@ -338,6 +342,10 @@ BuildRequires: kernel-source-virtualbox
BuildRequires: kernel-source-virtualbox-vboxadditions
%endif
%if %{with ccache}
BuildRequires: ccache
%endif
# might be useful too:
Recommends: microcode