Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v1, next] pkg-cmake: fix typo for the make backend
@ 2023-08-07 13:42 Thomas Devoogdt
  2023-08-07 17:37 ` Yann E. MORIN
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Devoogdt @ 2023-08-07 13:42 UTC (permalink / raw)
  To: buildroot; +Cc: Samuel Martin, Yann E . MORIN, Thomas Devoogdt

A small typo in commit 4cf79d9b71ff5cf2aede3f21e09ade7c7ac59606
causes the wrong path to be selected.

Cmake breaks on the first compiler check because it isn't
able to call the make program with the -jxx added.

$(firstword $$(MAKE)) --> -DCMAKE_MAKE_PROGRAM="/usr/bin/make -j13"
$(firstword $(MAKE)) --> -DCMAKE_MAKE_PROGRAM="/usr/bin/make"

Signed-off-by: Thomas Devoogdt <thomas.devoogdt@barco.com>
---
 package/pkg-cmake.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/pkg-cmake.mk b/package/pkg-cmake.mk
index e085fb2b5d..3483b50d46 100644
--- a/package/pkg-cmake.mk
+++ b/package/pkg-cmake.mk
@@ -65,7 +65,7 @@ endif
 ifeq ($$($(3)_CMAKE_BACKEND),make)
 $(2)_GENERATOR = "Unix Makefiles"
 # $$(MAKE) can be 'make -jN', we just want 'make'  (possibly with a full path)
-$(2)_GENERATOR_PROGRAM = $(firstword $$(MAKE))
+$(2)_GENERATOR_PROGRAM = $(firstword $(MAKE))
 # Generator specific code (make) should be avoided,
 # but for now, copy them to the new variables.
 $(2)_BUILD_ENV ?= $$($(2)_MAKE_ENV)
-- 
2.41.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Buildroot] [PATCH v1, next] pkg-cmake: fix typo for the make backend
  2023-08-07 13:42 [Buildroot] [PATCH v1, next] pkg-cmake: fix typo for the make backend Thomas Devoogdt
@ 2023-08-07 17:37 ` Yann E. MORIN
  0 siblings, 0 replies; 2+ messages in thread
From: Yann E. MORIN @ 2023-08-07 17:37 UTC (permalink / raw)
  To: Thomas Devoogdt; +Cc: Samuel Martin, Thomas Devoogdt, buildroot

Thomas, All,

On 2023-08-07 15:42 +0200, Thomas Devoogdt spake thusly:
> A small typo in commit 4cf79d9b71ff5cf2aede3f21e09ade7c7ac59606
> causes the wrong path to be selected.
> 
> Cmake breaks on the first compiler check because it isn't
> able to call the make program with the -jxx added.
> 
> $(firstword $$(MAKE)) --> -DCMAKE_MAKE_PROGRAM="/usr/bin/make -j13"
> $(firstword $(MAKE)) --> -DCMAKE_MAKE_PROGRAM="/usr/bin/make"
> 
> Signed-off-by: Thomas Devoogdt <thomas.devoogdt@barco.com>
> ---
>  package/pkg-cmake.mk | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/package/pkg-cmake.mk b/package/pkg-cmake.mk
> index e085fb2b5d..3483b50d46 100644
> --- a/package/pkg-cmake.mk
> +++ b/package/pkg-cmake.mk
> @@ -65,7 +65,7 @@ endif
>  ifeq ($$($(3)_CMAKE_BACKEND),make)
>  $(2)_GENERATOR = "Unix Makefiles"
>  # $$(MAKE) can be 'make -jN', we just want 'make'  (possibly with a full path)
> -$(2)_GENERATOR_PROGRAM = $(firstword $$(MAKE))
> +$(2)_GENERATOR_PROGRAM = $(firstword $(MAKE))

Actually, it is the $(firstword that must be double-dolared, because we
want the expansion to happen when the macro is evaluated (i.e. at the
time a package uses $(eval $(cmake-package)) ), not at the time it is
parsed (i.e. when make reads the Makefile).

That's because values, esp. paths, may differ. For example, if you
enable BR2_PER_PACKAGE_DIRECTORIES, and you have a package that needs
the Buildroot-built make, then a single dollar will evaluate to (e.g.)

    blabla/buildroot/output/host/bin/make

But that does not exist until the end of the build, and we want the
package to use its per-package directory, e.g.

    blabla/buildroot/output/per-package/MY_PACKAGE/host/bin/make

I've already fixed that localy, plus another similar issue on line 77,
where we want to use $$(HOST_DIR)/bin/ninja

I'll soon push the fix (I noticed yesterday while doing this big test
build, but forgot to push before hitting my bed...)

Regards,
Yann E. MORIN.

>  # Generator specific code (make) should be avoided,
>  # but for now, copy them to the new variables.
>  $(2)_BUILD_ENV ?= $$($(2)_MAKE_ENV)
> -- 
> 2.41.0
> 

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-08-07 17:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-07 13:42 [Buildroot] [PATCH v1, next] pkg-cmake: fix typo for the make backend Thomas Devoogdt
2023-08-07 17:37 ` Yann E. MORIN

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox