1
0
mirror of https://github.com/morrownr/8821cu-20210916.git synced 2024-11-25 23:04:27 +00:00

Fixing Makefile to respect out of tree builds as documented at https://docs.kernel.org/kbuild/modules.html

This change fixes an empty module target when invoked by `make -C <path_to_kernel_src> M=$PWD` due to missing `export CONFIG_RTL8821CU = m`.

Since kbuild only respects `obj-y := ...` for in-tree and `obj-m := ...` for out of tree builds, it is safe to assume obj-m to be the default as this mimicks existing behavior, still retaining the option to build in-tree if needed.
This commit is contained in:
pocketbroadcast 2024-08-21 20:44:39 +02:00 committed by GitHub
parent 58c0f9e69d
commit 9edb1b026c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2485,12 +2485,16 @@ ifeq ($(CONFIG_RTL8723B), y)
$(MODULE_NAME)-$(CONFIG_MP_INCLUDED)+= core/rtw_bt_mp.o $(MODULE_NAME)-$(CONFIG_MP_INCLUDED)+= core/rtw_bt_mp.o
endif endif
obj-$(CONFIG_RTL8821CU) := $(MODULE_NAME).o # export CONFIG_RTL8821CU=y to build driver in tree
# else driver will be built out of tree by default
ifeq ($(CONFIG_RTL8821CU), y)
obj-y := $(MODULE_NAME).o
else
obj-m := $(MODULE_NAME).o
endif
else else
export CONFIG_RTL8821CU = m
all: modules all: modules
modules: modules: