diff mbox series

[4/6] kbuild: deb-pkg: allow to run debian/rules from output directory

Message ID 20231226135243.1393780-4-masahiroy@kernel.org (mailing list archive)
State New, archived
Headers show
Series [1/6] kbuild: deb-pkg: factor out common Make options in debian/rules | expand

Commit Message

Masahiro Yamada Dec. 26, 2023, 1:52 p.m. UTC
'make O=... deb-pkg' creates the debian directory in the output
directory. However, currently it is impossible to run debian/rules
created in the separate output directory.

This commit delays the $(srctree) expansion by escaping '$' and by
quating the entire command, making it possible to run debian/rules in
the output directory.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/package/debian/rules | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Nicolas Schier Dec. 27, 2023, 8:09 a.m. UTC | #1
On Tue, Dec 26, 2023 at 10:52:41PM +0900, Masahiro Yamada wrote:
> 'make O=... deb-pkg' creates the debian directory in the output
> directory. However, currently it is impossible to run debian/rules
> created in the separate output directory.
> 
> This commit delays the $(srctree) expansion by escaping '$' and by
> quating the entire command, making it possible to run debian/rules in

quating -> quoting

> the output directory.
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---
> 
>  scripts/package/debian/rules | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/package/debian/rules b/scripts/package/debian/rules
> index 8f24a8e84bf2..6b2333e3cf96 100755
> --- a/scripts/package/debian/rules
> +++ b/scripts/package/debian/rules
> @@ -19,7 +19,7 @@ binary: binary-arch binary-indep
>  binary-indep: build-indep
>  binary-arch: build-arch
>  	$(MAKE) -f $(srctree)/Makefile $(make-opts) \
> -	run-command KBUILD_RUN_COMMAND=+$(srctree)/scripts/package/builddeb
> +	run-command KBUILD_RUN_COMMAND='+$${srctree}/scripts/package/builddeb'

That's a nice trick.

Reviewed-by: Nicolas Schier <n.schier@avm.de>

>  
>  .PHONY: build build-indep build-arch
>  build: build-arch build-indep
> -- 
> 2.40.1
>
diff mbox series

Patch

diff --git a/scripts/package/debian/rules b/scripts/package/debian/rules
index 8f24a8e84bf2..6b2333e3cf96 100755
--- a/scripts/package/debian/rules
+++ b/scripts/package/debian/rules
@@ -19,7 +19,7 @@  binary: binary-arch binary-indep
 binary-indep: build-indep
 binary-arch: build-arch
 	$(MAKE) -f $(srctree)/Makefile $(make-opts) \
-	run-command KBUILD_RUN_COMMAND=+$(srctree)/scripts/package/builddeb
+	run-command KBUILD_RUN_COMMAND='+$${srctree}/scripts/package/builddeb'
 
 .PHONY: build build-indep build-arch
 build: build-arch build-indep