Skip to contentSkip to conversation

pkg-cmake: fix typo for the make backend

PATCH In review Thomas Devoogdt 2 participants 2 messages Aug 7, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pkg-cmake: fix typo for the make backend

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"

---
 package/pkg-cmake.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/pkg-cmake.mk +1 -1
index e085fb2b5d..3483b50d46 100644
@@ -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)
Signature · 6 lines
2.41.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

Thomas, All,

On 2023-08-07 15:42 +0200, Thomas Devoogdt spake thusly:

Quoted 19 lines

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"

---
 package/pkg-cmake.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/pkg-cmake.mk +0 -0
index e085fb2b5d..3483b50d46 100644

package/pkg-cmake.mk endif · line 68

Quoted 5 lines
package/pkg-cmake.mk +1 -1
@@ -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.

Quoted 6 lines
package/pkg-cmake.mk +0 -0
 # Generator specific code (make) should be avoided,
 # but for now, copy them to the new variables.
 $(2)_BUILD_ENV ?= $$($(2)_MAKE_ENV)
Signature · 1 line
2.41.0
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  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
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot