# $M: this line is enabled only when CONFIG_MODULES is enabled
sed -e '/^DEL/d' -e 's/^\t*//' <<EOF
%{!?make: %define make make}
+%define makeflags %{?_smp_mflags}
Name: kernel
Summary: The Linux Kernel
$S patch -p1 < %{SOURCE2}
$S
$S %build
-$S %{make} %{?_smp_mflags} KERNELRELEASE=$KERNELRELEASE KBUILD_BUILD_VERSION=%{release}
+$S %{make} %{makeflags} KERNELRELEASE=$KERNELRELEASE KBUILD_BUILD_VERSION=%{release}
$S
%install
mkdir -p %{buildroot}/boot
%ifarch ia64
mkdir -p %{buildroot}/boot/efi
- cp \$(%{make} -s image_name) %{buildroot}/boot/efi/vmlinuz-$KERNELRELEASE
+ cp \$(%{make} %{makeflags} -s image_name) %{buildroot}/boot/efi/vmlinuz-$KERNELRELEASE
ln -s efi/vmlinuz-$KERNELRELEASE %{buildroot}/boot/
%else
- cp \$(%{make} -s image_name) %{buildroot}/boot/vmlinuz-$KERNELRELEASE
+ cp \$(%{make} %{makeflags} -s image_name) %{buildroot}/boot/vmlinuz-$KERNELRELEASE
%endif
-$M %{make} %{?_smp_mflags} INSTALL_MOD_PATH=%{buildroot} modules_install
- %{make} %{?_smp_mflags} INSTALL_HDR_PATH=%{buildroot}/usr headers_install
+$M %{make} %{makeflags} INSTALL_MOD_PATH=%{buildroot} modules_install
+ %{make} %{makeflags} INSTALL_HDR_PATH=%{buildroot}/usr headers_install
cp System.map %{buildroot}/boot/System.map-$KERNELRELEASE
cp .config %{buildroot}/boot/config-$KERNELRELEASE
$S$M rm -f %{buildroot}/lib/modules/$KERNELRELEASE/build