1 # SPDX-License-Identifier: GPL-2.0-only
3 # Copyright (C) 2006-2020 OpenWrt.org
8 ifeq ("$(origin V)", "command line")
12 ifeq ($(OPENWRT_VERBOSE
),1)
15 ifeq ($(OPENWRT_VERBOSE
),99)
19 ifeq ($(NO_TRACE_MAKE
),)
20 NO_TRACE_MAKE
:= $(MAKE
) V
=s
$(OPENWRT_VERBOSE
)
25 ifneq ($(strip $(NO_COLOR
)),1)
34 printf
"$(_R)%s$(_N)\n" "$(1)" >&9 || \
35 printf
"$(_R)%s$(_N)\n" "$(1)"; \
39 ifeq ($(findstring s
,$(OPENWRT_VERBOSE
)),)
42 printf
"$(_Y)%s$(_N)\n" "$(1)" >&8 || \
43 printf
"$(_Y)%s$(_N)\n" "$(1)"; \
48 ifneq ($(CURDIR
),$(TOPDIR
))
49 _DIR
:=$(patsubst $(TOPDIR
)/%,%,${CURDIR})
53 _MESSAGE
:=$(if
$(MAKECMDGOALS
),$(shell \
54 $(call MESSAGE
, make
[$(MAKELEVEL
)]$(if
$(_DIR
), -C
$(_DIR
)) $(MAKECMDGOALS
)); \
56 ifneq ($(strip $(_MESSAGE
)),)
61 SILENT
:=>/dev
/null
$(if
$(findstring w
,$(OPENWRT_VERBOSE
)),,2>&1)
63 SUBMAKE
=cmd
() { $(SILENT
) $(MAKE
) -s
"$$@" < /dev
/null ||
{ echo
"make $$*: build failed. Please re-run make with -j1 V=s or V=sc for a higher verbosity level to see what's going on"; false
; } } 8>&1 9>&2; cmd
66 .SILENT
: $(MAKECMDGOALS
)