aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2010-03-14 18:24:05 +0000
committerFelix Fietkau <nbd@openwrt.org>2010-03-14 18:24:05 +0000
commite9b2c3c8bb20ff79fa4c79f5e3d16f00afa11295 (patch)
treeef4d707fd3ef25386397df675d62db318365feca
parente1a1410dcccd1000d9f51a77c2dcc8d84c4db6da (diff)
downloadupstream-e9b2c3c8bb20ff79fa4c79f5e3d16f00afa11295.tar.gz
upstream-e9b2c3c8bb20ff79fa4c79f5e3d16f00afa11295.tar.bz2
upstream-e9b2c3c8bb20ff79fa4c79f5e3d16f00afa11295.zip
add an arch suffix for handling different variants of arm/mips for the toolchain/target directories
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20215 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r--rules.mk25
1 files changed, 21 insertions, 4 deletions
diff --git a/rules.mk b/rules.mk
index a7d7a34d55..c1ff95c0a5 100644
--- a/rules.mk
+++ b/rules.mk
@@ -44,6 +44,23 @@ else
FPIC:=-fpic
endif
+ARCH_SUFFIX:=
+ifneq ($(findstring -mips32r2,$(TARGET_OPTIMIZATION)),)
+ ARCH_SUFFIX:=_r2
+endif
+ifneq ($(findstring -march=armv4,$(TARGET_OPTIMIZATION)),)
+ ARCH_SUFFIX:=_v4
+endif
+ifneq ($(findstring -march=armv4t,$(TARGET_OPTIMIZATION)),)
+ ARCH_SUFFIX:=_v4t
+endif
+ifneq ($(findstring -march=armv5t,$(TARGET_OPTIMIZATION)),)
+ ARCH_SUFFIX:=_v5t
+endif
+ifneq ($(findstring -march=armv5te,$(TARGET_OPTIMIZATION)),)
+ ARCH_SUFFIX:=_v5te
+endif
+
DL_DIR:=$(if $(call qstrip,$(CONFIG_DOWNLOAD_FOLDER)),$(call qstrip,$(CONFIG_DOWNLOAD_FOLDER)),$(TOPDIR)/dl)
BIN_DIR:=$(TOPDIR)/bin/$(BOARD)
INCLUDE_DIR:=$(TOPDIR)/include
@@ -58,10 +75,10 @@ ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)
REAL_GNU_TARGET_NAME=$(OPTIMIZE_FOR_CPU)-openwrt-linux$(if $(TARGET_SUFFIX),-$(TARGET_SUFFIX))
GNU_TARGET_NAME=$(OPTIMIZE_FOR_CPU)-openwrt-linux
DIR_SUFFIX:=_$(LIBC)-$(LIBCV)$(if $(CONFIG_EABI_SUPPORT),_eabi)
- BUILD_DIR:=$(BUILD_DIR_BASE)/target-$(ARCH)$(DIR_SUFFIX)$(if $(BUILD_SUFFIX),_$(BUILD_SUFFIX))
- STAGING_DIR:=$(TOPDIR)/staging_dir/target-$(ARCH)$(DIR_SUFFIX)
- BUILD_DIR_TOOLCHAIN:=$(BUILD_DIR_BASE)/toolchain-$(ARCH)_gcc-$(GCCV)$(DIR_SUFFIX)
- TOOLCHAIN_DIR:=$(TOPDIR)/staging_dir/toolchain-$(ARCH)_gcc-$(GCCV)$(DIR_SUFFIX)
+ BUILD_DIR:=$(BUILD_DIR_BASE)/target-$(ARCH)$(ARCH_SUFFIX)$(DIR_SUFFIX)$(if $(BUILD_SUFFIX),_$(BUILD_SUFFIX))
+ STAGING_DIR:=$(TOPDIR)/staging_dir/target-$(ARCH)$(ARCH_SUFFIX)$(DIR_SUFFIX)
+ BUILD_DIR_TOOLCHAIN:=$(BUILD_DIR_BASE)/toolchain-$(ARCH)$(ARCH_SUFFIX)_gcc-$(GCCV)$(DIR_SUFFIX)
+ TOOLCHAIN_DIR:=$(TOPDIR)/staging_dir/toolchain-$(ARCH)$(ARCH_SUFFIX)_gcc-$(GCCV)$(DIR_SUFFIX)
PACKAGE_DIR:=$(BIN_DIR)/packages
else
ifeq ($(CONFIG_NATIVE_TOOLCHAIN),)