+HOST_FPIC:=-fPIC
+
+ARCH_SUFFIX:=
+GCC_ARCH:=
+
+ifneq ($(filter -march=armv%,$(TARGET_OPTIMIZATION)),)
+ ARCH_SUFFIX:=_$(patsubst -march=arm%,%,$(filter -march=armv%,$(TARGET_OPTIMIZATION)))
+ GCC_ARCH:=$(patsubst -march=%,%,$(filter -march=armv%,$(TARGET_OPTIMIZATION)))
+endif
+ifneq ($(findstring -mips32r2,$(TARGET_OPTIMIZATION)),)
+ ARCH_SUFFIX:=_r2
+endif
+ifdef CONFIG_HAS_SPE_FPU
+ TARGET_SUFFIX:=$(TARGET_SUFFIX)spe
+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
+SCRIPT_DIR:=$(TOPDIR)/scripts
+BUILD_DIR_BASE:=$(TOPDIR)/build_dir
+BUILD_DIR_HOST:=$(BUILD_DIR_BASE)/host
+STAGING_DIR_HOST:=$(TOPDIR)/staging_dir/host
+ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)
+ GCCV:=$(call qstrip,$(CONFIG_GCC_VERSION))
+ LIBC:=$(call qstrip,$(CONFIG_LIBC))
+ LIBCV:=$(call qstrip,$(CONFIG_LIBC_VERSION))
+ 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_arm),_eabi)
+ 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