diff mbox series

[RFC,05/11] kbuild: execute modules.order recipe in --dry-run mode

Message ID 20240819160309.2218114-6-vegard.nossum@oracle.com (mailing list archive)
State Handled Elsewhere
Headers show
Series output a valid shell script when running 'make -n' | expand

Commit Message

Vegard Nossum Aug. 19, 2024, 4:03 p.m. UTC
modules.order is read by scripts/Makefile.modfinal to determine which
modules to build, so we need this recipe to execute if we want to be able
to output the recipes for building modules in dry-run mode.

Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
---
 scripts/Makefile.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Nicolas Schier Nov. 2, 2024, 9:10 p.m. UTC | #1
On Mon, Aug 19, 2024 at 06:03:02PM +0200 Vegard Nossum wrote:
> modules.order is read by scripts/Makefile.modfinal to determine which
> modules to build, so we need this recipe to execute if we want to be able
> to output the recipes for building modules in dry-run mode.
> 
> Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
> ---
>  scripts/Makefile.build | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/Makefile.build b/scripts/Makefile.build
> index efacca63c8976..34f86dced67f3 100644
> --- a/scripts/Makefile.build
> +++ b/scripts/Makefile.build
> @@ -417,7 +417,7 @@ cmd_gen_order = { $(foreach m, $(real-prereqs), \
>  	> $@
>  
>  $(obj)/modules.order: $(obj-m) FORCE
> -	$(call if_changed,gen_order)
> +	+$(call if_changed,gen_order)

As it is a bit hacky to mark an always sequential command as 'recursive' [1] in
order to circumvent the '--dry-run', I'd like to see a comment in the code,
too.

[1]: https://www.gnu.org/software/make/manual/make.html#MAKE-Variable
diff mbox series

Patch

diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index efacca63c8976..34f86dced67f3 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -417,7 +417,7 @@  cmd_gen_order = { $(foreach m, $(real-prereqs), \
 	> $@
 
 $(obj)/modules.order: $(obj-m) FORCE
-	$(call if_changed,gen_order)
+	+$(call if_changed,gen_order)
 
 $(obj)/dtbs-list: $(dtb-y) FORCE
 	$(call if_changed,gen_order)