From af835ce5169cc7829928e8e224508526b9ef2870 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sat, 18 Oct 2008 21:43:30 +0000 Subject: change the way ./files* and the generic kernel files are applied. ./files now applies to *ALL* kernel versions, and is copied along with ./files-* - this gets rid of quite a bit of redundancy in the extra kernel drivers. git-svn-id: svn://svn.openwrt.org/openwrt/trunk@13010 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- include/kernel.mk | 2 +- include/quilt.mk | 7 ++----- include/target.mk | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/kernel.mk b/include/kernel.mk index 5232148a6b..a9a350bb28 100644 --- a/include/kernel.mk +++ b/include/kernel.mk @@ -31,7 +31,7 @@ else endif PATCH_DIR ?= ./patches$(shell [ -d "./patches-$(KERNEL_PATCHVER)" ] && printf -- "-$(KERNEL_PATCHVER)" || true ) - FILES_DIR ?= ./files$(shell [ -d "./files-$(KERNEL_PATCHVER)" ] && printf -- "-$(KERNEL_PATCHVER)" || true ) + FILES_DIR ?= $(foreach dir,$(wildcard ./files ./files-$(KERNEL_PATCHVER)),"$(dir)") KERNEL_BUILD_DIR ?= $(BUILD_DIR_BASE)/linux-$(BOARD)$(if $(SUBTARGET),_$(SUBTARGET))$(if $(BUILD_SUFFIX),_$(BUILD_SUFFIX)) LINUX_DIR ?= $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION) diff --git a/include/quilt.mk b/include/quilt.mk index 70bc84e4cc..c569231173 100644 --- a/include/quilt.mk +++ b/include/quilt.mk @@ -68,11 +68,8 @@ endef define Kernel/Patch/Default rm -rf $(PKG_BUILD_DIR)/patches; mkdir -p $(PKG_BUILD_DIR)/patches - if [ -d $(GENERIC_FILES_DIR) ]; then $(CP) $(GENERIC_FILES_DIR)/* $(LINUX_DIR)/; fi - if [ -d $(FILES_DIR) ]; then \ - $(CP) $(FILES_DIR)/* $(LINUX_DIR)/; \ - find $(LINUX_DIR)/ -name \*.rej | xargs rm -f; \ - fi + $(CP) $(foreach fdir,$(GENERIC_FILES_DIR) $(FILES_DIR),$(fdir)/.) $(LINUX_DIR)/ + find $(LINUX_DIR)/ -name \*.rej -or -name \*.orig | $(XARGS) rm -f $(call PatchDir,$(GENERIC_PATCH_DIR),generic/) $(call PatchDir,$(PATCH_DIR),platform/) endef diff --git a/include/target.mk b/include/target.mk index 5b7bf9829e..f34cf5b32e 100644 --- a/include/target.mk +++ b/include/target.mk @@ -108,7 +108,7 @@ include $(INCLUDE_DIR)/kernel-version.mk GENERIC_PLATFORM_DIR := $(TOPDIR)/target/linux/generic-$(KERNEL) GENERIC_PATCH_DIR := $(GENERIC_PLATFORM_DIR)/patches$(shell [ -d "$(GENERIC_PLATFORM_DIR)/patches-$(KERNEL_PATCHVER)" ] && printf -- "-$(KERNEL_PATCHVER)" || true ) -GENERIC_FILES_DIR := $(GENERIC_PLATFORM_DIR)/files$(shell [ -d "$(GENERIC_PLATFORM_DIR)/files-$(KERNEL_PATCHVER)" ] && printf -- "-$(KERNEL_PATCHVER)" || true ) +GENERIC_FILES_DIR := $(foreach dir,$(wildcard $(GENERIC_PLATFORM_DIR)/files $(GENERIC_PLATFORM_DIR)/files-$(KERNEL_PATCHVER)),"$(dir)") GENERIC_LINUX_CONFIG?=$(firstword $(wildcard $(GENERIC_PLATFORM_DIR)/config-$(KERNEL_PATCHVER) $(GENERIC_PLATFORM_DIR)/config-default)) LINUX_CONFIG?=$(firstword $(wildcard $(foreach subdir,$(PLATFORM_DIR) $(PLATFORM_SUBDIR),$(subdir)/config-$(KERNEL_PATCHVER) $(subdir)/config-default)) $(PLATFORM_DIR)/config-$(KERNEL_PATCHVER)) -- cgit v1.2.3