Skip to content

Commit 0e22d63

Browse files
committed
build: fix CONFIG_AUTOREMOVE for packages with multiple variants
Calling the clean target removes all .ipk files and un-stages the package. Add a new target just for clearing the build dir and call that one instead of the full clean target Signed-off-by: Felix Fietkau <[email protected]>
1 parent 34ec245 commit 0e22d63

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

include/host-build.mk

+7-2
Original file line numberDiff line numberDiff line change
@@ -176,15 +176,20 @@ ifndef DUMP
176176
$(t): host-$(t)
177177
.$(t): .host-$(t)
178178
)
179+
clean-build: host-clean-build
179180
endif
180181

181182
$(_host_target)host-prepare: $(HOST_STAMP_PREPARED)
182183
$(_host_target)host-configure: $(HOST_STAMP_CONFIGURED)
183184
$(_host_target)host-compile: $(HOST_STAMP_BUILT) $(HOST_STAMP_INSTALLED)
184-
host-clean: FORCE
185+
186+
host-clean-build: FORCE
187+
rm -rf $(HOST_BUILD_DIR) $(HOST_STAMP_BUILT)
188+
189+
host-clean: host-clean-build
185190
$(call Host/Clean)
186191
$(call Host/Uninstall)
187-
rm -rf $(HOST_BUILD_DIR) $(HOST_STAMP_INSTALLED) $(HOST_STAMP_BUILT)
192+
rm -rf $(HOST_STAMP_INSTALLED)
188193

189194
ifneq ($(CONFIG_AUTOREMOVE),)
190195
host-compile:

include/package.mk

+4-2
Original file line numberDiff line numberDiff line change
@@ -300,12 +300,14 @@ compile: prepare-package-install
300300
.install: .compile
301301
install: compile
302302

303-
clean: FORCE
303+
clean-build: FORCE
304+
rm -rf $(PKG_BUILD_DIR)
305+
306+
clean: clean-build
304307
$(CleanStaging)
305308
$(call Build/UninstallDev,$(STAGING_DIR),$(STAGING_DIR_HOST))
306309
$(Build/Clean)
307310
rm -f $(STAGING_DIR)/packages/$(STAGING_FILES_LIST) $(STAGING_DIR_HOST)/packages/$(STAGING_FILES_LIST)
308-
rm -rf $(PKG_BUILD_DIR)
309311

310312
dist:
311313
$(Build/Dist)

include/subdir.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ rebuild_check = \
5252
$(if $(BUILD_LOG),mkdir -p $(BUILD_LOG_DIR)/$(1)$(if $(4),/$(4));) \
5353
$$(NO_TRACE_MAKE) $(if $(BUILD_LOG),-d) -q $(subdir_make_opts) .$(if $(3),$(3)-)$(2) \
5454
> $(if $(BUILD_LOG),$(BUILD_LOG_DIR)/$(1)$(if $(4),/$(4))/check-$(if $(3),$(3)-)$(2).txt,/dev/null) 2>&1 || \
55-
$$(SUBMAKE) $(subdir_make_opts) clean >/dev/null 2>/dev/null
55+
$$(SUBMAKE) $(subdir_make_opts) clean-build >/dev/null 2>/dev/null
5656

5757
endif
5858

0 commit comments

Comments
 (0)