mirror of
https://abf.rosa.ru/djam/kernel-5.15.git
synced 2025-02-24 02:52:55 +00:00
Add ccache switch, useful for local rebuilds
This commit is contained in:
parent
2812a67ad1
commit
ed3d48040b
1 changed files with 11 additions and 3 deletions
14
kernel.spec
14
kernel.spec
|
@ -85,6 +85,8 @@
|
||||||
%bcond_with binary_extra_modules
|
%bcond_with binary_extra_modules
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
%bcond_with ccache
|
||||||
|
|
||||||
# Kernel flavour
|
# Kernel flavour
|
||||||
%if %{with nickel}
|
%if %{with nickel}
|
||||||
%define flavour nickel
|
%define flavour nickel
|
||||||
|
@ -175,11 +177,13 @@
|
||||||
%define debug_package %{nil}
|
%define debug_package %{nil}
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if %(if [ -z "$CC" ] ; then echo 0; else echo 1; fi)
|
# http://nickdesaulniers.github.io/blog/2018/06/02/speeding-up-linux-kernel-builds-with-ccache/
|
||||||
%define kmake %make CC="$CC"
|
%if %{with ccache}
|
||||||
|
%define kmake KBUILD_BUILD_TIMESTAMP='' %make CC='ccache gcc'
|
||||||
%else
|
%else
|
||||||
%define kmake %make
|
%define kmake %make CC='gcc'
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
# there are places where parallel make don't work
|
# there are places where parallel make don't work
|
||||||
%define smake make
|
%define smake make
|
||||||
|
|
||||||
|
@ -338,6 +342,10 @@ BuildRequires: kernel-source-virtualbox
|
||||||
BuildRequires: kernel-source-virtualbox-vboxadditions
|
BuildRequires: kernel-source-virtualbox-vboxadditions
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
%if %{with ccache}
|
||||||
|
BuildRequires: ccache
|
||||||
|
%endif
|
||||||
|
|
||||||
# might be useful too:
|
# might be useful too:
|
||||||
Recommends: microcode
|
Recommends: microcode
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue