allow targets to select/deselect config symbols
[oweals/openwrt.git] / include / quilt.mk
index 667653f320b30f6d096dbbf739d00243510850b5..1b191ddcba962e3ae9f6d30ca0e63deca3e9a41b 100644 (file)
@@ -54,10 +54,11 @@ endef
 QUILT?=$(strip $(shell test -f $(PKG_BUILD_DIR)/.quilt_used && echo y))
 ifneq ($(QUILT),)
   STAMP_PATCHED:=$(PKG_BUILD_DIR)/.quilt_patched
+  STAMP_CHECKED:=$(PKG_BUILD_DIR)/.quilt_checked
   override CONFIG_AUTOREBUILD=
-  $(STAMP_CONFIGURED): $(STAMP_PATCHED) FORCE
+  $(STAMP_CONFIGURED): $(STAMP_CHECKED) FORCE
   prepare: $(STAMP_PATCHED)
-  quilt-check: $(STAMP_PATCHED)
+  quilt-check: $(STAMP_CHECKED)
 endif
 
 define Build/Patch/Default
@@ -119,7 +120,10 @@ $(STAMP_PATCHED): $(STAMP_PREPARED)
                        find * -type f \! -name series | sort > series; \
                fi; \
        )
-       if [ -s "$(PKG_BUILD_DIR)/patches/series" ]; then (cd $(PKG_BUILD_DIR); quilt push -a); fi
+       touch $@
+
+$(STAMP_CHECKED): $(STAMP_PATCHED)
+       if [ -s "$(PKG_BUILD_DIR)/patches/series" ]; then (cd $(PKG_BUILD_DIR); quilt next >/dev/null 2>&1 && quilt push -a || quilt top >/dev/null 2>&1); fi
        touch $@
 
 define Build/Quilt