build: Fix print without color
[openwrt/openwrt.git] / include / scan.mk
index 86d9576c8247be8a49a795d54e9c43594ee64e5a..d9cd4f7e8c30845a3de2725275e1188c694ed3a5 100644 (file)
@@ -12,10 +12,22 @@ OVERRIDELIST:=$(TMP_DIR)/info/.overrides-$(SCAN_TARGET)-$(SCAN_COOKIE)
 
 export PATH:=$(TOPDIR)/staging_dir/host/bin:$(PATH)
 
+ifeq ($(SCAN_NAME),target)
+  SCAN_DEPS=image/Makefile profiles/*.mk $(TOPDIR)/include/kernel*.mk $(TOPDIR)/include/target.mk image/*.mk
+else
+  SCAN_DEPS=$(TOPDIR)/include/package*.mk
+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
+       printf "\r$(1)" >&2;
+    endef
+  endif
 else
   define progress
        :;