On 27.08.22 10:59, Henning Schild wrote:
> External modules might have their own appends and target definitions in
> their Makefile. All we need to give them is the target name and KDIR,
> not dive into KDIR right away.
My observation with external modules makefile having their own rules is
that they generally also have their own KDIR variables. There is no
standard way of telling those pick up the kernel from a standard place
and install it at the standard location.
>
> Signed-off-by: Henning Schild <
henning...@siemens.com>
> ---
> meta/recipes-kernel/linux-module/files/debian/rules.tmpl | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/meta/recipes-kernel/linux-module/files/debian/rules.tmpl b/meta/recipes-kernel/linux-module/files/debian/rules.tmpl
> index d3bd7dc30f21..0d16186b5ff3 100755
> --- a/meta/recipes-kernel/linux-module/files/debian/rules.tmpl
> +++ b/meta/recipes-kernel/linux-module/files/debian/rules.tmpl
> @@ -48,13 +48,13 @@ KDIR := $(shell dpkg -L $(KERNEL_DEP) | grep "/lib/modules/.*/build")
> endif
>
> override_dh_auto_clean:
> - $(MAKE) -C $(KDIR) M=$(PWD) clean
> + $(MAKE) KDIR=$(KDIR) clean
>
> override_dh_auto_build:
> - $(MAKE) -C $(KDIR) M=$(PWD) modules
> + $(MAKE) KDIR=$(KDIR) modules
>
> override_dh_auto_install:
> - $(MAKE) -C $(KDIR) M=$(PWD) INSTALL_MOD_PATH=$(PWD)/debian/${PN} modules_install
> + $(MAKE) KDIR=$(KDIR) INSTALL_MOD_PATH=$(PWD)/debian/${PN} modules_install
>
> %:
> CFLAGS= LDFLAGS= dh $@ --parallel
This breaks existing users with makefile that are unusable or do not
have own rules. I would refrain from that breakage.
If you have a more complex case than what we support, you can simply
provide your own rules and can then even account for the other
specialties that usually come with such module makefiles.
Same arguing applies to patch 3.