build: Honour NO_COLOR in include/scan.mk
[openwrt/openwrt.git] / include / scan.mk
index e6b21b27b009ce14f8683980add8d2be3bea9340..724dbfaf179f2bf343d36de38549c7b647a3dff5 100644 (file)
@@ -19,9 +19,15 @@ else
 endif
 
 ifeq ($(IS_TTY),1)
-  define progress
+  ifneq ($(strip $(NO_COLOR)),1)
+    define progress
        printf "\033[M\r$(1)" >&2;
-  endef
+    endef
+  else
+    define progress
+       :;
+    endef
+  endif
 else
   define progress
        :;