##############################################################
ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
BASE_TARGETS:=uclibc-configured binutils cross_compiler uclibc-target-utils kernel-headers
-else
+else ifeq ($(BR2_TOOLCHAIN_EXTERNAL),y)
BASE_TARGETS:=uclibc
endif
TARGETS:=
include toolchain/mklibs/mklibs.mk
include toolchain/sstrip/sstrip.mk
include toolchain/uClibc/uclibc.mk
-else
+else ifeq ($(BR2_TOOLCHAIN_EXTERNAL),y)
include toolchain/*/*.mk
endif
ifeq ($(BR2_TOOLCHAIN_SYSROOT),y)
@mkdir -p $(STAGING_DIR)/usr/lib
else
-ifneq ($(BR2_TOOLCHAIN_EXTERNAL),y)
+ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
@ln -snf . $(STAGING_DIR)/usr
@mkdir -p $(STAGING_DIR)/usr/$(REAL_GNU_TARGET_NAME)
@ln -snf ../lib $(STAGING_DIR)/usr/lib
TARGET_CXXFLAGS=$(TARGET_CFLAGS)
-# else it's an external toolchain
#########################################################################
-else
+else ifeq ($(BR2_TOOLCHAIN_EXTERNAL),y)
TARGET_CFLAGS=$(TARGET_OPTIMIZATION) $(TARGET_DEBUGGING) --sysroot $(STAGING_DIR)/
TARGET_CXXFLAGS=$(TARGET_CFLAGS)
TARGET_LDFLAGS=--sysroot $(STAGING_DIR)/
REAL_GNU_TARGET_NAME=$(OPTIMIZE_FOR_CPU)$(GNU_TARGET_SUFFIX)
TARGET_CROSS=$(STAGING_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-
KERNEL_CROSS=$(TARGET_CROSS)
-else
+else ifeq ($(BR2_TOOLCHAIN_EXTERNAL),y)
TOOLCHAIN_EXTERNAL_PREFIX:=$(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_PREFIX))
TOOLCHAIN_EXTERNAL_PATH:=$(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_PATH))
TOOLCHAIN_DIR=$(BASE_DIR)/toolchain
TARGET_RANLIB=$(TARGET_CROSS)ranlib
TARGET_OBJCOPY=$(TARGET_CROSS)objcopy
TARGET_OBJDUMP=$(TARGET_CROSS)objdump
-ifeq ($(BR2_TOOLCHAIN_EXTERNAL),y)
-TARGET_LDCONFIG=/sbin/ldconfig
-else
+ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
TARGET_LDCONFIG=$(TARGET_CROSS)ldconfig
+else ifeq ($(BR2_TOOLCHAIN_EXTERNAL),y)
+TARGET_LDCONFIG=/sbin/ldconfig
endif
ifeq ($(BR2_STRIP_strip),y)
STRIP_DISCARD_ALL:=--discard-all