2 # copy_toolchain_lib_root
6 # $2: strip (y|n) default is to strip
8 copy_toolchain_lib_root
= \
11 STRIP
="$(strip $3)"; \
13 LIB_DIR
=`$(TARGET_CC) -print-file-name=$${LIB} | sed -e "s,/$${LIB}\$$,,"`; \
15 if
test -z
"$${LIB_DIR}"; then \
16 echo
"copy_toolchain_lib_root: lib=$${LIB} not found"; \
21 for FILE in
`find $${LIB_DIR} -maxdepth 1 -type l -name "$${LIB}*"`; do \
22 LIB
=`basename $${FILE}`; \
23 while
test \
! -z
"$${LIB}"; do \
24 echo
"copy_toolchain_lib_root lib=$${LIB} dst=$${DST}"; \
25 rm -fr
$(TARGET_DIR
)$${DST}/$${LIB}; \
26 mkdir
-p
$(TARGET_DIR
)$${DST}; \
27 if
test -h
$${LIB_DIR}/$${LIB}; then \
28 cp
-d
$${LIB_DIR}/$${LIB} $(TARGET_DIR
)$${DST}/; \
29 elif
test -f
$${LIB_DIR}/$${LIB}; then \
30 cp
$${LIB_DIR}/$${LIB} $(TARGET_DIR
)$${DST}/$${LIB}; \
35 $(TARGET_CROSS
)strip "$(TARGET_DIR)$${DST}/$${LIB}"; \
41 LIB
="`readlink $${LIB_DIR}/$${LIB}`"; \
47 uclibc
: $(dependencies
) $(TARGET_DIR
)/lib
/$(strip $(subst ",, $(BR2_TOOLCHAIN_EXTERNAL_LIB_C)))
49 $(TARGET_DIR)/lib/$(strip $(subst ",, $(BR2_TOOLCHAIN_EXTERNAL_LIB_C
))):
51 mkdir
-p
$(TARGET_DIR
)/lib
52 @
$(call copy_toolchain_lib_root
, $(strip $(subst ",, $(BR2_TOOLCHAIN_EXTERNAL_LIB_C))), /lib, $(BR2_TOOLCHAIN_EXTERNAL_STRIP))
54 for libs in
$(strip $(subst ",, $(BR2_TOOLCHAIN_EXTERNAL_LIBS))); do \
55 $(call copy_toolchain_lib_root, $$libs, /lib, $(BR2_TOOLCHAIN_EXTERNAL_STRIP)); \