From 160a4812cdd846f82f1f0bfb3798ada760d84d22 Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Tue, 3 Dec 2024 11:00:24 +1100 Subject: [PATCH] esp32: Pass V=1 or BUILD_VERBOSE through to idf.py when building. Allows verbose build to work the same on esp32 port as other ports. To minimise copy/paste, split the BUILD_VERBOSE section of mkenv.mk out to its own verbose.mk and include this in the port Makefile. Signed-off-by: Angus Gratton --- ports/esp32/Makefile | 6 ++++++ py/mkenv.mk | 17 +---------------- py/verbose.mk | 16 ++++++++++++++++ 3 files changed, 23 insertions(+), 16 deletions(-) create mode 100644 py/verbose.mk diff --git a/ports/esp32/Makefile b/ports/esp32/Makefile index 4ad3cf0267..8888180766 100644 --- a/ports/esp32/Makefile +++ b/ports/esp32/Makefile @@ -2,6 +2,8 @@ # # This is a simple, convenience wrapper around idf.py (which uses cmake). +include ../../py/verbose.mk + # Select the board to build for: ifdef BOARD_DIR # Custom board path - remove trailing slash and get the final component of @@ -61,6 +63,10 @@ ifdef MICROPY_PREVIEW_VERSION_2 IDFPY_FLAGS += -D MICROPY_PREVIEW_VERSION_2=1 endif +ifeq ($(BUILD_VERBOSE),1) + IDFPY_FLAGS += --verbose +endif + HELP_BUILD_ERROR ?= "See \033[1;31mhttps://github.com/micropython/micropython/wiki/Build-Troubleshooting\033[0m" define RUN_IDF_PY diff --git a/py/mkenv.mk b/py/mkenv.mk index b52dafbc9d..4656d11366 100644 --- a/py/mkenv.mk +++ b/py/mkenv.mk @@ -12,22 +12,7 @@ endif THIS_MAKEFILE := $(lastword $(MAKEFILE_LIST)) TOP := $(patsubst %/py/mkenv.mk,%,$(THIS_MAKEFILE)) -# Turn on increased build verbosity by defining BUILD_VERBOSE in your main -# Makefile or in your environment. You can also use V=1 on the make command -# line. - -ifeq ("$(origin V)", "command line") -BUILD_VERBOSE=$(V) -endif -ifndef BUILD_VERBOSE -$(info Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.) -BUILD_VERBOSE = 0 -endif -ifeq ($(BUILD_VERBOSE),0) -Q = @ -else -Q = -endif +include $(TOP)/py/verbose.mk # default settings; can be overridden in main Makefile diff --git a/py/verbose.mk b/py/verbose.mk new file mode 100644 index 0000000000..734623a21e --- /dev/null +++ b/py/verbose.mk @@ -0,0 +1,16 @@ +# Turn on increased build verbosity by defining BUILD_VERBOSE in your main +# Makefile or in your environment. You can also use V=1 on the make command +# line. + +ifeq ("$(origin V)", "command line") +BUILD_VERBOSE=$(V) +endif +ifndef BUILD_VERBOSE +$(info Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.) +BUILD_VERBOSE = 0 +endif +ifeq ($(BUILD_VERBOSE),0) +Q = @ +else +Q = +endif