Skip to content

Commit

Permalink
verbose.mk: debug printing ERROR MESSAGES in (non-)verbose mode
Browse files Browse the repository at this point in the history
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
  • Loading branch information
guidosarducci committed Nov 13, 2023
1 parent c771795 commit 6eb6dcc
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions include/verbose.mk
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ifeq ($(OPENWRT_VERBOSE),99)
endif

ifeq ($(NO_TRACE_MAKE),)
NO_TRACE_MAKE := $(MAKE) V=s$(OPENWRT_VERBOSE)
NO_TRACE_MAKE := 8>&1 9>&2 $(MAKE) V=s$(OPENWRT_VERBOSE)
export NO_TRACE_MAKE
endif

Expand All @@ -31,11 +31,11 @@ endif

ifeq ($(findstring s,$(OPENWRT_VERBOSE)),)
define MESSAGE
printf "$(_Y)%s$(_N)\n" "$(1)" >&8
printf "FD=8 V=$(OPENWRT_VERBOSE):$(_Y)%s$(_N)\n" "$(1)" >&8
endef

define ERROR_MESSAGE
printf "$(_R)%s$(_N)\n" "$(1)" >&8
printf "FD=9 V=$(OPENWRT_VERBOSE):$(_R)%s$(_N)\n" "$(1)" >&9
endef

ifeq ($(QUIET),1)
Expand All @@ -45,7 +45,7 @@ ifeq ($(findstring s,$(OPENWRT_VERBOSE)),)
_DIR:=
endif
_NULL:=$(if $(MAKECMDGOALS),$(shell \
$(call MESSAGE, make[$(MAKELEVEL)]$(if $(_DIR), -C $(_DIR)) $(MAKECMDGOALS)); \
$(call MESSAGE, V=$(OPENWRT_VERBOSE):make[$(MAKELEVEL)]$(if $(_DIR), -C $(_DIR)) $(MAKECMDGOALS)); \
))
SUBMAKE=$(MAKE)
else
Expand All @@ -58,7 +58,9 @@ ifeq ($(findstring s,$(OPENWRT_VERBOSE)),)
else
SUBMAKE=$(MAKE) -w
define MESSAGE
printf "%s\n" "$(1)"
printf "FD=1 V=$(OPENWRT_VERBOSE):%s\n" "$(1)"
endef
define ERROR_MESSAGE
printf "FD=2 V=$(OPENWRT_VERBOSE):%s\n" "$(1)" >&2
endef
ERROR_MESSAGE=$(MESSAGE)
endif

0 comments on commit 6eb6dcc

Please sign in to comment.