KERNEL_CROSS?=$(TARGET_CROSS)
endif
- PATCH_DIR ?= ./patches$(shell [ -d "./patches-$(KERNEL_PATCHVER)" ] && printf -- "-$(KERNEL_PATCHVER)" || true )
+ PATCH_DIR ?= ./patches$(if $(wildcard ./patches-$(KERNEL_PATCHVER)),-$(KERNEL_PATCHVER))
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)
endif
ifneq (,$(findstring uml,$(BOARD)))
- LINUX_KARCH:=um
+ LINUX_KARCH=um
else
ifeq (,$(LINUX_KARCH))
- LINUX_KARCH:=$(shell echo $(ARCH) | sed -e 's/i[3-9]86/x86/' \
+ LINUX_KARCH=$(shell echo $(ARCH) | sed -e 's/i[3-9]86/x86/' \
-e 's/mipsel/mips/' \
-e 's/mipseb/mips/' \
-e 's/sh[234]/sh/' \
add_module $(1) "$(2)";
endef
-define CompareKernelPatchVer
- $(shell [ $$(echo $(1) | tr . 0) -$(2) $$(echo $(3) | tr . 0) ] && echo 1 || echo 0)
-endef
+ifdef DUMP
+ CompareKernelPatchVer=0
+else
+ define CompareKernelPatchVer
+ $(shell [ $$(echo $(1) | tr . 0) -$(2) $$(echo $(3) | tr . 0) ] && echo 1 || echo 0)
+ endef
+endif
PROVIDES:=
EXTRA_DEPENDS:=
MAINTAINER:=OpenWrt Developers Team <openwrt-devel@openwrt.org>
- SOURCE:=$(patsubst $(TOPDIR)/%,%,${shell pwd})
+ SOURCE:=$(patsubst $(TOPDIR)/%,%,$(CURDIR))
ifneq ($(PKG_VERSION),)
ifneq ($(PKG_RELEASE),)
VERSION:=$(PKG_VERSION)-$(PKG_RELEASE)
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
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 $(wildcard $(if $(PKG_BUILD_DIR),$(PKG_BUILD_DIR),$(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
endif
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_PATCH_DIR := $(GENERIC_PLATFORM_DIR)/patches$(if $(wildcard $(GENERIC_PLATFORM_DIR)/patches-$(KERNEL_PATCHVER)),-$(KERNEL_PATCHVER))
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))
export SHELL=/usr/bin/env bash -c '. $(TOPDIR)/include/shell.sh; eval "$$2"' --
-define qstrip
-$(strip $(subst ",,$(1)))
-endef
+qstrip=$(strip $(subst ",,$(1)))
#"))
empty:=
strip_last=$(patsubst %.$(lastword $(subst .,$(space),$(1))),%,$(1))
_SINGLE=export MAKEFLAGS=$(space);
-ARCH:=$(call qstrip,$(shell echo $(CONFIG_ARCH) | sed -e 's/i[3-9]86/i386/'))
+ARCH:=$(subst i486,i386,$(subst i586,i386,$(subst i686,i386,$(call qstrip,$(CONFIG_ARCH)))))
BOARD:=$(call qstrip,$(CONFIG_TARGET_BOARD))
TARGET_OPTIMIZATION:=$(call qstrip,$(CONFIG_TARGET_OPTIMIZATION))
TARGET_SUFFIX=$(call qstrip,$(CONFIG_TARGET_SUFFIX))
LIBCV:=$(call qstrip,$(CONFIG_LIBC_VERSION))
SUBDIR:=$(patsubst $(TOPDIR)/%,%,${CURDIR})
-OPTIMIZE_FOR_CPU=$(shell echo $(ARCH) | sed -e 's/i386/i486/')
+OPTIMIZE_FOR_CPU=$(subst i386,i486,$(ARCH))
ifeq ($(ARCH),powerpc)
FPIC:=-fPIC