ext-tool.mk 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #
  2. # copy_toolchain_lib_root
  3. #
  4. # $1: source
  5. # $2: destination
  6. # $2: strip (y|n) default is to strip
  7. #
  8. copy_toolchain_lib_root = \
  9. LIB="$(strip $1)"; \
  10. DST="$(strip $2)"; \
  11. STRIP="$(strip $3)"; \
  12. \
  13. LIB_DIR=`$(TARGET_CC) -print-file-name=$${LIB} | sed -e "s,/$${LIB}\$$,,"`; \
  14. \
  15. if test -z "$${LIB_DIR}"; then \
  16. echo "copy_toolchain_lib_root: lib=$${LIB} not found"; \
  17. exit -1; \
  18. fi; \
  19. \
  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; \
  44. \
  45. echo -n
  46. uclibc: dependencies $(TARGET_DIR)/lib/$(strip $(subst ",, $(BR2_TOOLCHAIN_EXTERNAL_LIB_C)))
  47. $(TARGET_DIR)/lib/$(strip $(subst ",, $(BR2_TOOLCHAIN_EXTERNAL_LIB_C))):
  48. #"))
  49. mkdir -p $(TARGET_DIR)/lib
  50. @$(call copy_toolchain_lib_root, $(strip $(subst ",, $(BR2_TOOLCHAIN_EXTERNAL_LIB_C))), /lib, $(BR2_TOOLCHAIN_EXTERNAL_STRIP))
  51. #")))
  52. for libs in $(strip $(subst ",, $(BR2_TOOLCHAIN_EXTERNAL_LIBS))); do \
  53. $(call copy_toolchain_lib_root, $$libs, /lib, $(BR2_TOOLCHAIN_EXTERNAL_STRIP)); \
  54. done