• Masahiro Yamada's avatar
    kbuild: add workaround for Debian make-kpkg · d972d1c0
    Masahiro Yamada authored
    commit 2b50f7ab upstream.
    
    Since commit 3812b8c5 ("kbuild: make -r/-R effective in top
    Makefile for old Make versions"), make-kpkg is not working.
    
    make-kpkg directly includes the top Makefile of Linux kernel, and
    appends some debian_* targets.
    
      /usr/share/kernel-package/ruleset/kernel_version.mk:
    
        # Include the kernel makefile
        override dot-config := 1
        include Makefile
        dot-config := 1
    
    I did not know the kernel Makefile was used in that way, and it is
    hard to guarantee the behavior when the kernel Makefile is included
    by another Makefile from a different project.
    
    It looks like Debian Stretch stopped providing make-kpkg. Maybe it is
    obsolete and being replaced with 'make deb-pkg' etc. but still widely
    used.
    
    This commit adds a workaround; if the top Makefile is included by
    another Makefile, skip sub-make in order to make the main part visible.
    'MAKEFLAGS += -rR' does not become effective for GNU Make < 4.0, but
    Debian/Ubuntu is already using newer versions.
    
    The effect of this commit:
    
      Debian 8 (Jessie)  : Fixed
      Debian 9 (Stretch) : make-kpkg (kernel-package) is not provided
      Ubuntu 14.04 LTS   : NOT Fixed
      Ubuntu 16.04 LTS   : Fixed
      Ubuntu 18.04 LTS   : Fixed
    
    This commit cannot fix Ubuntu 14.04 because it installs GNU Make 3.81,
    but its support will end in Apr 2019, which is before the Linux v5.1
    release.
    
    I added warning so that nobody would try to include the top Makefile.
    
    Fixes: 3812b8c5 ("kbuild: make -r/-R effective in top Makefile for old Make versions")
    Reported-by: 's avatarLiz Zhang <lizzha@microsoft.com>
    Signed-off-by: 's avatarMasahiro Yamada <yamada.masahiro@socionext.com>
    Tested-by: 's avatarLili Deng <v-lide@microsoft.com>
    Cc: Manoj Srivastava <srivasta@debian.org>
    Signed-off-by: 's avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    d972d1c0
Name
Last commit
Last update
Documentation Loading commit data...
LICENSES Loading commit data...
arch Loading commit data...
block Loading commit data...
certs Loading commit data...
crypto Loading commit data...
drivers Loading commit data...
firmware Loading commit data...
fs Loading commit data...
include Loading commit data...
init Loading commit data...
ipc Loading commit data...
kernel Loading commit data...
lib Loading commit data...
mm Loading commit data...
net Loading commit data...
samples Loading commit data...
scripts Loading commit data...
security Loading commit data...
sound Loading commit data...
tools Loading commit data...
usr Loading commit data...
virt Loading commit data...
.clang-format Loading commit data...
.cocciconfig Loading commit data...
.get_maintainer.ignore Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
COPYING Loading commit data...
CREDITS Loading commit data...
Kbuild Loading commit data...
Kconfig Loading commit data...
MAINTAINERS Loading commit data...
Makefile Loading commit data...
README Loading commit data...