replace a few unnecessary $(shell) calls
SVN-Revision: 14739
This commit is contained in:
parent
f3c14b3de8
commit
431c9267b4
5 changed files with 17 additions and 15 deletions
|
@ -30,7 +30,7 @@ else
|
||||||
KERNEL_CROSS?=$(TARGET_CROSS)
|
KERNEL_CROSS?=$(TARGET_CROSS)
|
||||||
endif
|
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)")
|
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))
|
KERNEL_BUILD_DIR ?= $(BUILD_DIR_BASE)/linux-$(BOARD)$(if $(SUBTARGET),_$(SUBTARGET))$(if $(BUILD_SUFFIX),_$(BUILD_SUFFIX))
|
||||||
LINUX_DIR ?= $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)
|
LINUX_DIR ?= $(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)
|
||||||
|
@ -50,10 +50,10 @@ else
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq (,$(findstring uml,$(BOARD)))
|
ifneq (,$(findstring uml,$(BOARD)))
|
||||||
LINUX_KARCH:=um
|
LINUX_KARCH=um
|
||||||
else
|
else
|
||||||
ifeq (,$(LINUX_KARCH))
|
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/mipsel/mips/' \
|
||||||
-e 's/mipseb/mips/' \
|
-e 's/mipseb/mips/' \
|
||||||
-e 's/sh[234]/sh/' \
|
-e 's/sh[234]/sh/' \
|
||||||
|
@ -159,7 +159,11 @@ define AutoLoad
|
||||||
add_module $(1) "$(2)";
|
add_module $(1) "$(2)";
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define CompareKernelPatchVer
|
ifdef DUMP
|
||||||
$(shell [ $$(echo $(1) | tr . 0) -$(2) $$(echo $(3) | tr . 0) ] && echo 1 || echo 0)
|
CompareKernelPatchVer=0
|
||||||
endef
|
else
|
||||||
|
define CompareKernelPatchVer
|
||||||
|
$(shell [ $$(echo $(1) | tr . 0) -$(2) $$(echo $(3) | tr . 0) ] && echo 1 || echo 0)
|
||||||
|
endef
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ define Package/Default
|
||||||
PROVIDES:=
|
PROVIDES:=
|
||||||
EXTRA_DEPENDS:=
|
EXTRA_DEPENDS:=
|
||||||
MAINTAINER:=OpenWrt Developers Team <openwrt-devel@openwrt.org>
|
MAINTAINER:=OpenWrt Developers Team <openwrt-devel@openwrt.org>
|
||||||
SOURCE:=$(patsubst $(TOPDIR)/%,%,${shell pwd})
|
SOURCE:=$(patsubst $(TOPDIR)/%,%,$(CURDIR))
|
||||||
ifneq ($(PKG_VERSION),)
|
ifneq ($(PKG_VERSION),)
|
||||||
ifneq ($(PKG_RELEASE),)
|
ifneq ($(PKG_RELEASE),)
|
||||||
VERSION:=$(PKG_VERSION)-$(PKG_RELEASE)
|
VERSION:=$(PKG_VERSION)-$(PKG_RELEASE)
|
||||||
|
|
|
@ -56,7 +56,7 @@ $(call PatchDir/$(if $(strip $(QUILT)),Quilt,Default),$(strip $(1)),$(strip $(2)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
ifneq ($(PKG_BUILD_DIR),)
|
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),)
|
ifneq ($(QUILT),)
|
||||||
STAMP_PATCHED:=$(PKG_BUILD_DIR)/.quilt_patched
|
STAMP_PATCHED:=$(PKG_BUILD_DIR)/.quilt_patched
|
||||||
STAMP_CHECKED:=$(PKG_BUILD_DIR)/.quilt_checked
|
STAMP_CHECKED:=$(PKG_BUILD_DIR)/.quilt_checked
|
||||||
|
@ -67,7 +67,7 @@ ifneq ($(PKG_BUILD_DIR),)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(HOST_BUILD_DIR),)
|
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),)
|
ifneq ($(HOST_QUILT),)
|
||||||
HOST_STAMP_PATCHED:=$(HOST_BUILD_DIR)/.quilt_patched
|
HOST_STAMP_PATCHED:=$(HOST_BUILD_DIR)/.quilt_patched
|
||||||
HOST_STAMP_CHECKED:=$(HOST_BUILD_DIR)/.quilt_checked
|
HOST_STAMP_CHECKED:=$(HOST_BUILD_DIR)/.quilt_checked
|
||||||
|
|
|
@ -109,7 +109,7 @@ ifneq ($(TARGET_BUILD)$(if $(DUMP),,1),)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
GENERIC_PLATFORM_DIR := $(TOPDIR)/target/linux/generic-$(KERNEL)
|
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_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))
|
GENERIC_LINUX_CONFIG?=$(firstword $(wildcard $(GENERIC_PLATFORM_DIR)/config-$(KERNEL_PATCHVER) $(GENERIC_PLATFORM_DIR)/config-default))
|
||||||
|
|
8
rules.mk
8
rules.mk
|
@ -19,9 +19,7 @@ TMP_DIR:=$(TOPDIR)/tmp
|
||||||
|
|
||||||
export SHELL=/usr/bin/env bash -c '. $(TOPDIR)/include/shell.sh; eval "$$2"' --
|
export SHELL=/usr/bin/env bash -c '. $(TOPDIR)/include/shell.sh; eval "$$2"' --
|
||||||
|
|
||||||
define qstrip
|
qstrip=$(strip $(subst ",,$(1)))
|
||||||
$(strip $(subst ",,$(1)))
|
|
||||||
endef
|
|
||||||
#"))
|
#"))
|
||||||
|
|
||||||
empty:=
|
empty:=
|
||||||
|
@ -31,7 +29,7 @@ confvar=$(call merge,$(foreach v,$(1),$(if $($(v)),y,n)))
|
||||||
strip_last=$(patsubst %.$(lastword $(subst .,$(space),$(1))),%,$(1))
|
strip_last=$(patsubst %.$(lastword $(subst .,$(space),$(1))),%,$(1))
|
||||||
|
|
||||||
_SINGLE=export MAKEFLAGS=$(space);
|
_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))
|
BOARD:=$(call qstrip,$(CONFIG_TARGET_BOARD))
|
||||||
TARGET_OPTIMIZATION:=$(call qstrip,$(CONFIG_TARGET_OPTIMIZATION))
|
TARGET_OPTIMIZATION:=$(call qstrip,$(CONFIG_TARGET_OPTIMIZATION))
|
||||||
TARGET_SUFFIX=$(call qstrip,$(CONFIG_TARGET_SUFFIX))
|
TARGET_SUFFIX=$(call qstrip,$(CONFIG_TARGET_SUFFIX))
|
||||||
|
@ -41,7 +39,7 @@ LIBC:=$(call qstrip,$(CONFIG_LIBC))
|
||||||
LIBCV:=$(call qstrip,$(CONFIG_LIBC_VERSION))
|
LIBCV:=$(call qstrip,$(CONFIG_LIBC_VERSION))
|
||||||
SUBDIR:=$(patsubst $(TOPDIR)/%,%,${CURDIR})
|
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)
|
ifeq ($(ARCH),powerpc)
|
||||||
FPIC:=-fPIC
|
FPIC:=-fPIC
|
||||||
|
|
Loading…
Reference in a new issue