add PKG_HOST_ONLY variable to prevent target builds
[openwrt/staging/florian.git] / include / quilt.mk
index 71fee06f14a36680ba4d93f054220ca20926bba9..fbb3e01e351d1c3b98bcdd6836b2a08cf5660117 100644 (file)
@@ -3,9 +3,8 @@
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
-#
 
-ifneq ($(__quilt_inc),1)
+ifneq ($(if $(DUMP),1,$(__quilt_inc)),1)
 __quilt_inc:=1
 
 ifeq ($(TARGET_BUILD),1)
@@ -57,7 +56,7 @@ $(call PatchDir/$(if $(strip $(QUILT)),Quilt,Default),$(strip $(1)),$(strip $(2)
 endef
 
 ifneq ($(PKG_BUILD_DIR),)
-  QUILT?=$(strip $(shell test -f $(PKG_BUILD_DIR)/.quilt_used && echo y))
+  QUILT?=$(if $(wildcard $(PKG_BUILD_DIR)/.quilt_used),y)
   ifneq ($(QUILT),)
     STAMP_PATCHED:=$(PKG_BUILD_DIR)/.quilt_patched
     STAMP_CHECKED:=$(PKG_BUILD_DIR)/.quilt_checked
@@ -68,7 +67,7 @@ ifneq ($(PKG_BUILD_DIR),)
 endif
 
 ifneq ($(HOST_BUILD_DIR),)
-  HOST_QUILT?=$(strip $(shell test -f $(if $(PKG_BUILD_DIR),$(PKG_BUILD_DIR),$(HOST_BUILD_DIR))/.quilt_used && echo y))
+  HOST_QUILT?=$(if $(findstring command,$(origin $(QUILT))),$(QUILT),$(if $(wildcard $(HOST_BUILD_DIR)/.quilt_used),y))
   ifneq ($(HOST_QUILT),)
     HOST_STAMP_PATCHED:=$(HOST_BUILD_DIR)/.quilt_patched
     HOST_STAMP_CHECKED:=$(HOST_BUILD_DIR)/.quilt_checked