pass ARCH down to uClibc
[buildroot.git] / toolchain / external-toolchain / ext-tool.mk
blobb4351796671510b8d58fcd7992064ae804028f2d
2 # copy_toolchain_lib_root
4 # $1: source
5 # $2: destination
6 # $3: strip (y|n) default is to strip
8 copy_toolchain_lib_root = \
9 LIB="$(strip $1)"; \
10 DST="$(strip $2)"; \
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"; \
17 exit -1; \
18 fi; \
20 LIB="$(strip $1)"; \
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}; \
31 case "$${STRIP}" in \
32 (0 | n | no) \
33 ;; \
34 (*) \
35 $(TARGET_CROSS)strip "$(TARGET_DIR)$${DST}/$${LIB}"; \
36 ;; \
37 esac; \
38 else \
39 exit -1; \
40 fi; \
41 LIB="`readlink $${LIB_DIR}/$${LIB}`"; \
42 done; \
43 done; \
45 echo -n
47 uclibc: $(dependencies) $(TARGET_DIR)/lib/$(strip $(subst ",, $(BR2_TOOLCHAIN_EXTERNAL_LIB_C)))
49 $(TARGET_DIR)/lib/$(strip $(subst ",, $(BR2_TOOLCHAIN_EXTERNAL_LIB_C))):
50 #"))
51 mkdir -p $(TARGET_DIR)/lib
52 @$(call copy_toolchain_lib_root, $(strip $(subst ",, $(BR2_TOOLCHAIN_EXTERNAL_LIB_C))), /lib, $(BR2_TOOLCHAIN_EXTERNAL_STRIP))
53 #")))
54 for libs in $(strip $(subst ",, $(BR2_TOOLCHAIN_EXTERNAL_LIBS))); do \
55 $(call copy_toolchain_lib_root, $$libs, /lib, $(BR2_TOOLCHAIN_EXTERNAL_STRIP)); \
56 done