build: reconfigure when selection state of subpackages changes
authorYousong Zhou <yszhou4tech@gmail.com>
Fri, 2 Mar 2018 08:27:12 +0000 (16:27 +0800)
committerYousong Zhou <yszhou4tech@gmail.com>
Fri, 2 Mar 2018 09:43:03 +0000 (17:43 +0800)
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
include/package.mk

index 78ea5d0ef8b73e758466b48f4a9d652daae7d59c..6c0b4347451db626d8de42ae6af6fd341e2d566d 100644 (file)
@@ -71,6 +71,8 @@ ifneq ($(PREV_STAMP_PREPARED),)
 else
   STAMP_PREPARED=$(PKG_BUILD_DIR)/.prepared$(if $(QUILT)$(DUMP),,_$(shell $(call find_md5,${CURDIR} $(PKG_FILE_DEPENDS),))_$(call confvar,CONFIG_AUTOREMOVE $(PKG_PREPARED_DEPENDS)))
 endif
+STAMP_SELECTED_PACKAGES=$(PKG_BUILD_DIR)/.selected_packages$(if $(DUMP),,_$(words $(BUILD_PACKAGES))_$(call confvar,$(patsubst %,CONFIG_PACKAGE_%,$(BUILD_PACKAGES))))
+STAMP_SELECTED_PACKAGES_WILDCARD=$(PKG_BUILD_DIR)/.selected_packages_$(words $(BUILD_PACKAGES))_*
 STAMP_CONFIGURED=$(PKG_BUILD_DIR)/.configured$(if $(DUMP),,_$(call confvar,$(PKG_CONFIG_DEPENDS)))
 STAMP_CONFIGURED_WILDCARD=$(PKG_BUILD_DIR)/.configured_*
 STAMP_BUILT:=$(PKG_BUILD_DIR)/.built
@@ -253,6 +255,10 @@ endif
 
   BUILD_PACKAGES += $(1)
   $(STAMP_PREPARED): $$(if $(QUILT)$(DUMP),,$(call find_library_dependencies,$(DEPENDS)))
+  $(STAMP_CONFIGURED): $$(STAMP_SELECTED_PACKAGES)
+  $$(STAMP_SELECTED_PACKAGES):
+       rm -f $$(STAMP_SELECTED_PACKAGES_WILDCARD)
+       touch $$@
 
   $(foreach FIELD, TITLE CATEGORY SECTION VERSION,
     ifeq ($($(FIELD)),)