Skip to content

Commit

Permalink
Makefile: support out-of-source kernel build directory
Browse files Browse the repository at this point in the history
Yocto stores kernel source and build trees in separate
directories, where the latter contains the .config file.

KERNELDIR and KERNELBUILDDIR correspond to the Yocto variables
STAGING_KERNEL_DIR and STAGING_KERNEL_BUILDDIR, respectively.

Link: https://docs.yoctoproject.org/4.3/kernel-dev/common.html#incorporating-out-of-tree-modules
Link: https://docs.yoctoproject.org/4.3/ref-manual/variables.html#term-STAGING_KERNEL_DIR
Link: https://docs.yoctoproject.org/4.3/ref-manual/variables.html#term-STAGING_KERNEL_BUILDDIR
Signed-off-by: Peter Colberg <[email protected]>
  • Loading branch information
pcolberg committed Mar 20, 2024
1 parent 87f3eb6 commit 2ea87d9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

KERNEL ?= $(shell uname -r)
KERNELDIR ?= /lib/modules/$(KERNEL)/build
KERNELBUILDDIR ?= $(KERNELDIR)
LINUXINCLUDE := -I$(src)/include -I$(src)/include/uapi $(LINUXINCLUDE)

# make Kconfig conditionals always work
include $(KERNELDIR)/.config
include $(KERNELBUILDDIR)/.config

ifeq ($(DEBUG),1)
DYNDBG = dyndbg=+p
Expand Down

0 comments on commit 2ea87d9

Please sign in to comment.