kernel: update 4.1 to 4.1.4
[openwrt/openwrt.git] / include / quilt.mk
index 6c4839ba4ac324efc5f226e03c9bf548c6fb8572..3377eb105533fbbcf16144d121613ce59d42d680 100644 (file)
@@ -1,4 +1,4 @@
-# 
+#
 # Copyright (C) 2007-2009 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
@@ -39,12 +39,13 @@ define PatchDir/Quilt
 endef
 
 define PatchDir/Default
-       @if [ -d "$(2)" -a "$$$$(ls $(2) | wc -l)" -gt 0 ]; then \
+       @if [ -d "$(2)" ] && [ "$$$$(ls $(2) | wc -l)" -gt 0 ]; then \
+               export PATCH="$(PATCH)"; \
                if [ -s "$(2)/series" ]; then \
                        $(call filter_series,$(2)/series) | xargs -n1 \
-                               $(PATCH) "$(1)" "$(2)"; \
+                               $(KPATCH) "$(1)" "$(2)"; \
                else \
-                       $(PATCH) "$(1)" "$(2)"; \
+                       $(KPATCH) "$(1)" "$(2)"; \
                fi; \
        fi
 endef
@@ -124,7 +125,8 @@ define Quilt/Refresh/Kernel
 endef
 
 define Quilt/Template
-  $($(2)STAMP_CONFIGURED): $($(2)STAMP_CHECKED) FORCE
+  $($(2)STAMP_CONFIGURED): $($(2)STAMP_CHECKED)
+  $(if $(NO_RECONFIGURE),$($(2)STAMP_BUILT),$($(2)STAMP_CONFIGURED)): FORCE
   $($(2)STAMP_CHECKED): $($(2)STAMP_PREPARED)
        if [ -s "$(1)/patches/series" ]; then \
                (cd "$(1)"; \