1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-11-24 03:18:26 +02:00

replace a few unnecessary $(shell) calls

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@14739 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
nbd 2009-03-03 14:55:53 +00:00
parent b158be34cf
commit 8e52b00c08
5 changed files with 17 additions and 15 deletions

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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))

View File

@ -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