-toolchain/uClibc/prepare:=toolchain/kernel-headers/prepare
-ifeq ($(CONFIG_NATIVE_TOOLCHAIN),)
- toolchain/binutils/prepare:=toolchain/uClibc/prepare
- toolchain/gcc/prepare:=toolchain/binutils/install
- toolchain/uClibc/compile:=toolchain/gcc/compile
+ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)
+ $(curdir)/$(LIBC)/prepare:=$(curdir)/kernel-headers/install
+ $(curdir)/gcc/prepare:=$(curdir)/binutils/install
+ $(curdir)/kernel-headers/install:=$(curdir)/gcc/prepare
+ $(curdir)/gcc/compile:=$(curdir)/$(LIBC)/prepare
+ $(curdir)/$(LIBC)/compile:=$(curdir)/gcc/compile
+ $(curdir)/gcc/install:=$(curdir)/$(LIBC)/compile
+ $(curdir)/$(LIBC)/install:=$(curdir)/gcc/install
+ ifneq ($(CONFIG_GLIBC_PORTS),)
+ $(curdir)/glibc/prepare:=$(curdir)/glibc-ports/prepare
+ endif
+endif
+
+ifdef CONFIG_GCC_VERSION_LLVM
+ $(curdir)/builddirs += llvm
+ $(curdir)/gcc/prepare += $(curdir)/llvm/install
+endif
+
+ifneq ($(ARCH),)
+ $(TOOLCHAIN_DIR)/info.mk: .config
+ @for dir in $(TOOLCHAIN_DIR); do ( \
+ set -x; \
+ mkdir -p "$$dir"; \
+ cd "$$dir"; \
+ mkdir -p stamp lib usr/include usr/lib ; \
+ ); done
+ @grep GCC_VERSION $@ >/dev/null 2>&1 || $(INSTALL_DATA) $(TOPDIR)/toolchain/info.mk $@
+ @touch $@