Use a kernel source outside the default directory /usr/src/linux

genkernel

  • Gentoo Linux utility to compile and install kernels.
    More information: <https://wiki.gentoo.org/wiki/Genkernel>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

sudo genkernel --kerneldir={{path/to/directory}} all

click the source code to copy