[Buildroot] [PATCH] Makefile: add good message when user try make O=$PWD -C path/to/buildroot without cd /tmp/build

AndreiCherniaev cherniaev.andrei at kairo.space
Mon Jan 9 05:05:24 UTC 2023


From: AndreiCherniaev <dungeonlords789 at yandex.ru>

https://buildroot.org/downloads/manual/manual.html
There is "8.5. Building out-of-tree". There is example of using
$ cd /tmp/build; make O=$PWD -C path/to/buildroot
but when user ignore cd /tmp/build; there is message
"error Please configure Buildroot first (e.g. "make menuconfig")"
but this message is not correct. I suggest a new message in this case. This is message from my PC:
"error Please go to your output directory first (e.g. "cd /home/username/Downloads/myGit/buildroot_O_bug/O_folder; make menuconfig")"

Signed-off-by: AndreiCherniaev <dungeonlords789 at yandex.ru>
---
 Makefile | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 88f90cd2fa..176be12ac4 100644
--- a/Makefile
+++ b/Makefile
@@ -945,7 +945,11 @@ else # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
 # Also for 'all' we error out and ask the user to configure first.
 .PHONY: linux toolchain
 linux toolchain all: outputmakefile
-	$(error Please configure Buildroot first (e.g. "make menuconfig"))
+	ifeq ($(NEED_WRAPPER),y)  # ifeq ("$(origin O)", "command line") # O := $(CURDIR)/output
+		$(error Please go to your output directory first (e.g. "cd $(O); make menuconfig"))
+	else
+		$(error Please configure Buildroot first (e.g. "make menuconfig"))
+	endif
 	@exit 1
 
 endif # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
-- 
2.34.1




More information about the buildroot mailing list