Преглед изворни кода

build: extend CONFIG_AUTOREMOVE to tools/

Signed-off-by: Felix Fietkau <[email protected]>
Felix Fietkau пре 8 година
родитељ
комит
d98bb7e6b9
3 измењених фајлова са 8 додато и 0 уклоњено
  1. 6 0
      include/host-build.mk
  2. 1 0
      include/toolchain-build.mk
  3. 1 0
      tools/Makefile

+ 6 - 0
include/host-build.mk

@@ -172,6 +172,7 @@ ifndef DUMP
   ifndef STAMP_BUILT
     $(foreach t,$(DEFAULT_SUBDIR_TARGETS),
       $(t): host-$(t)
+      .$(t): .host-$(t)
     )
   endif
 
@@ -183,6 +184,11 @@ ifndef DUMP
 	$(call Host/Uninstall)
 	rm -rf $(HOST_BUILD_DIR) $(HOST_STAMP_INSTALLED) $(HOST_STAMP_BUILT)
 
+    ifneq ($(CONFIG_AUTOREMOVE),)
+      host-compile:
+		$(FIND) $(HOST_BUILD_DIR) -mindepth 1 -maxdepth 1 -not '(' -type f -and -name '.*' -and -size 0 ')' | \
+			$(XARGS) rm -rf
+    endif
   endef
 endif
 

+ 1 - 0
include/toolchain-build.mk

@@ -6,6 +6,7 @@
 #
 
 override CONFIG_AUTOREBUILD=
+override CONFIG_AUTOREMOVE=
 
 REAL_STAGING_DIR_HOST:=$(STAGING_DIR_HOST)
 STAGING_DIR_HOST:=$(TOOLCHAIN_DIR)

+ 1 - 0
tools/Makefile

@@ -100,6 +100,7 @@ $(foreach tool, $(tools-core), $(eval $(curdir)/$(tool)/compile += $(curdir)/sed
 $(curdir)/sed/compile := $(curdir)/flock/compile
 tools-y += flock sed
 
+$(curdir)/autoremove := 1
 $(curdir)/builddirs := $(tools-y) $(tools-dep) $(tools-)
 $(curdir)/builddirs-default := $(tools-y)