build: Suffix build directory with _$(LIBC) for external toolchains
authorFlorian Fainelli <f.fainelli@gmail.com>
Sun, 15 Jan 2017 04:04:38 +0000 (20:04 -0800)
committerJo-Philipp Wich <jo@mein.io>
Wed, 13 Dec 2017 13:15:08 +0000 (14:15 +0100)
For external toolchain, we also know the type of C library used, and the
toolchain triplet may not always be reflective of that, therefore make
$(TARGET_DIR_NAME) suffixed with _$(LIBC).

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
(cherry picked from commit 57657a72376000b5843367e627098f09fe9c3647)

rules.mk

index d58f8d92d3edcb2db72f0440ff1c1619219f7abe..1ed80f11b85dfaa744c7b994e9d07058774caee7 100644 (file)
--- a/rules.mk
+++ b/rules.mk
@@ -124,7 +124,8 @@ else
     GNU_TARGET_NAME=$(shell gcc -dumpmachine)
   endif
   REAL_GNU_TARGET_NAME=$(GNU_TARGET_NAME)
-  TARGET_DIR_NAME:=target-$(GNU_TARGET_NAME)$(if $(BUILD_SUFFIX),_$(BUILD_SUFFIX))
+  LIBC:=$(call qstrip,$(CONFIG_LIBC))
+  TARGET_DIR_NAME:=target-$(GNU_TARGET_NAME)_$(LIBC)$(if $(BUILD_SUFFIX),_$(BUILD_SUFFIX))
   TOOLCHAIN_DIR_NAME:=toolchain-$(GNU_TARGET_NAME)
 endif