On an x86_64 host I have cross-compiled a Linux kernel for an ARM target out-of tree. So I have two directories:
- ~/kernel_git_repo/ - contains kernel source only
- ~/kernel_buld_dir/ - contains the .config file and built kernel objects
In a third directory
- ~/external_module - sources for an external kernel module
I have the source code for an external module, with a Makefile.
The "usual" command for an in-tree built kernel would be:
make -C <path-to-compiled-src-code> M=$(PWD) modules
For my out-of-tree built kernel, neither ~/kernel_git_repo/ nor ~/kernel_buld_dir/ work as <path-to-compiled-src-code>
. It appears that the make command needs both the kernel source repo with the Kbuild infrastructure and the build directory with the .config
file and the objects.
In this situation, what is the make command to use in the ~/external_module/Makefile for building the module?