diff options
author | Thomas De Schampheleire <thomas.de_schampheleire@nokia.com> | 2017-02-07 22:56:47 +0100 |
---|---|---|
committer | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2017-04-05 21:33:04 +0200 |
commit | d34e02a6578baa5c5ebe1a9f08654bdf3d079fdd (patch) | |
tree | a7345ebc3ca98e9c6cc2ed172ffcb3d63736f5f2 | |
parent | eff1980194a26c85143ef775e270901704106832 (diff) | |
download | buildroot-d34e02a6578baa5c5ebe1a9f08654bdf3d079fdd.tar.gz buildroot-d34e02a6578baa5c5ebe1a9f08654bdf3d079fdd.zip |
toolchain: copy_toolchain_lib_root: clarify logic
copy_toolchain_lib_root has slightly different logic depending on the type
of library object: file or link. All actions related to links are not
relevant in case you are working with a file. Hence, try to increase clarity
by not executing unnecessary lines in the 'file' case.
Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
-rw-r--r-- | toolchain/helpers.mk | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk index 319fbd4419..0ec9da42f2 100644 --- a/toolchain/helpers.mk +++ b/toolchain/helpers.mk @@ -17,19 +17,17 @@ copy_toolchain_lib_root = \ mkdir -p $(TARGET_DIR)/$${DESTDIR}; \ while true ; do \ LIBNAME=`basename $${LIBPATH}`; \ - LINKTARGET=`readlink $${LIBPATH}` ; \ rm -fr $(TARGET_DIR)/$${DESTDIR}/$${LIBNAME}; \ if test -h $${LIBPATH} ; then \ + LINKTARGET=`readlink $${LIBPATH}` ; \ ln -sf `basename $${LINKTARGET}` $(TARGET_DIR)/$${DESTDIR}/$${LIBNAME} ; \ + LIBPATH="`readlink -f $${LIBPATH}`"; \ elif test -f $${LIBPATH}; then \ $(INSTALL) -D -m0755 $${LIBPATH} $(TARGET_DIR)/$${DESTDIR}/$${LIBNAME}; \ + break ; \ else \ exit -1; \ fi; \ - if test -z "$${LINKTARGET}" ; then \ - break ; \ - fi ; \ - LIBPATH="`readlink -f $${LIBPATH}`"; \ done; \ done |