X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=include%2Fquilt.mk;h=cd392a7c5dd024ac97c55157900570eb7707be66;hb=a93accd73dba6d56247a1076e62c612b31e4ebc3;hp=f5b852c3ce44e835a7f4f55882b08348efb52a90;hpb=24dee6de525b4575abaf589f921f044937fdb0d2;p=librecmc%2Flibrecmc.git diff --git a/include/quilt.mk b/include/quilt.mk index f5b852c3ce..cd392a7c5d 100644 --- a/include/quilt.mk +++ b/include/quilt.mk @@ -1,4 +1,4 @@ -# +# # Copyright (C) 2007-2009 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. @@ -17,6 +17,7 @@ HOST_FILES_DIR?=$(FILES_DIR) ifeq ($(MAKECMDGOALS),refresh) override QUILT=1 + override HOST_QUILT=1 endif QUILT_CMD:=quilt --quiltrc=- @@ -39,12 +40,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 @@ -67,7 +69,7 @@ ifneq ($(PKG_BUILD_DIR),) endif ifneq ($(HOST_BUILD_DIR),) - HOST_QUILT?=$(if $(findstring command,$(origin $(QUILT))),$(QUILT),$(if $(wildcard $(HOST_BUILD_DIR)/.quilt_used),y)) + HOST_QUILT?=$(if $(findstring command,$(origin QUILT)),$(QUILT),$(if $(wildcard $(HOST_BUILD_DIR)/.quilt_used),y)) ifneq ($(HOST_QUILT),) HOST_STAMP_CHECKED:=$(HOST_BUILD_DIR)/.quilt_checked override CONFIG_AUTOREBUILD= @@ -89,7 +91,7 @@ endef kernel_files=$(foreach fdir,$(GENERIC_FILES_DIR) $(FILES_DIR),$(fdir)/.) define Kernel/Patch/Default - rm -rf $(PKG_BUILD_DIR)/patches; mkdir -p $(PKG_BUILD_DIR)/patches + $(if $(QUILT),rm -rf $(PKG_BUILD_DIR)/patches; mkdir -p $(PKG_BUILD_DIR)/patches) $(if $(kernel_files),$(CP) $(kernel_files) $(LINUX_DIR)/) find $(LINUX_DIR)/ -name \*.rej -or -name \*.orig | $(XARGS) rm -f $(call PatchDir,$(PKG_BUILD_DIR),$(GENERIC_PATCH_DIR),generic/) @@ -100,8 +102,8 @@ define Quilt/RefreshDir mkdir -p $(2) -rm -f $(2)/* 2>/dev/null >/dev/null @( \ - for patch in $$$$($(if $(3),grep "^$(3)",cat) $(PKG_BUILD_DIR)/patches/series | awk '{print $$$$1}'); do \ - $(CP) -v "$(PKG_BUILD_DIR)/patches/$$$$patch" $(2); \ + for patch in $$$$($(if $(3),grep "^$(3)",cat) $(1)/patches/series | awk '{print $$$$1}'); do \ + $(CP) -v "$(1)/patches/$$$$patch" $(2); \ done; \ ) endef @@ -124,7 +126,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)"; \