uboot-mvebu: backport patch for Turris Omnia to enable LTO
[openwrt/openwrt.git] / include / verbose.mk
index 4487a207e87775812a7088369156465508a20ef5..f6aa0d701213907f8493afa408d723a246a7686c 100644 (file)
@@ -30,12 +30,18 @@ ifeq ($(IS_TTY),1)
 endif
 
 define ERROR_MESSAGE
-  printf "$(_R)%s$(_N)\n" "$(1)" >&8
+  { \
+       printf "$(_R)%s$(_N)\n" "$(1)" >&9 || \
+       printf "$(_R)%s$(_N)\n" "$(1)"; \
+  } >&2 2>/dev/null
 endef
 
 ifeq ($(findstring s,$(OPENWRT_VERBOSE)),)
   define MESSAGE
-       printf "$(_Y)%s$(_N)\n" "$(1)" >&8
+       { \
+               printf "$(_Y)%s$(_N)\n" "$(1)" >&8 || \
+               printf "$(_Y)%s$(_N)\n" "$(1)"; \
+       } 2>/dev/null
   endef
 
   ifeq ($(QUIET),1)
@@ -44,9 +50,12 @@ ifeq ($(findstring s,$(OPENWRT_VERBOSE)),)
     else
       _DIR:=
     endif
-    _NULL:=$(if $(MAKECMDGOALS),$(shell \
+    _MESSAGE:=$(if $(MAKECMDGOALS),$(shell \
                $(call MESSAGE, make[$(MAKELEVEL)]$(if $(_DIR), -C $(_DIR)) $(MAKECMDGOALS)); \
     ))
+    ifneq ($(strip $(_MESSAGE)),)
+      $(info $(_MESSAGE))
+    endif
     SUBMAKE=$(MAKE)
   else
     SILENT:=>/dev/null $(if $(findstring w,$(OPENWRT_VERBOSE)),,2>&1)