diff options
author | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2019-05-13 22:18:47 (EDT) |
---|---|---|
committer | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2019-05-13 22:35:31 (EDT) |
commit | 8b99dae63000dfdcc667d6d46785010df894194a (patch) | |
tree | 77c6c591bc98d0011adb24110bde620adadc6ab3 /build | |
parent | 4e1efd2b149623cba9f53f13697b39cd7d3176e5 (diff) |
build: Simplify/improve /usr/bin/* handling
Adds a prefix to /usr/bin/*gcov-* files.
Diffstat (limited to 'build')
-rwxr-xr-x | build | 28 |
1 files changed, 8 insertions, 20 deletions
@@ -19,6 +19,7 @@ installcross_targets = installcross-$(OPK_HOST_ARCH) base_version = $$(printf '%s\n' '$(OPK_SOURCE)' | sed 's/^gcc-//') target = $$(printf '%s' '$@' | sed 's/^[a-z]*-//') +target_gnu = $$(oh-architecture $(target)) builddir = obj-$(target) destdir = dest-$(target) @@ -159,19 +160,10 @@ $(installnative_targets): oh-autoinstall -B "$(builddir)" -d "$(destdir)" -T install -- \ user_tooldir_prefix="/usr/lib/$(target)/gcc-$(base_version)" # Change the target architecture prefix of files in /usr/bin. - rm -f $(destdir)/usr/bin/*-gcc-$(base_version).* - for f in c++ g++ gcc gcc-ar gcc-nm gcc-ranlib; do \ - rm -f $(destdir)/usr/bin/$${f}-$(base_version); \ - mv $(destdir)/usr/bin/*-$${f}-$(base_version) \ - $(destdir)/usr/bin/$(target)-$$(printf '%s' \ - $(destdir)/usr/bin/*-$${f}-$(base_version) | \ - sed "s/^.*-\($${f}\)/\1/"); \ - ln -sf $(target)-$$(printf '%s' \ - $(destdir)/usr/bin/*-$${f}-$(base_version) | \ - sed "s/^.*-\($${f}\)/\1/") \ - $(destdir)/usr/bin/$$(printf '%s' \ - $(destdir)/usr/bin/*-$${f}-$(base_version) | \ - sed "s/^.*-\($${f}\)/\1/"); \ + rm -f $(destdir)/usr/bin/$(target_gnu)-* + for f in $(destdir)/usr/bin/*; do f="$${f##*/}"; \ + mv $(destdir)/usr/bin/$${f} $(destdir)/usr/bin/$(target)-$${f};\ + ln -s $(target)-$${f} $(destdir)/usr/bin/$${f}; \ done # Move libstdc++.so link. rm -f $(destdir)/usr/lib/$(target)/libstdc++.so @@ -277,13 +269,9 @@ $(installcross_targets): toolexeclibdir="/usr/lib/$(target)" \ MULTIOSDIR=. # Change the target architecture prefix of files in /usr/bin. - rm -f $(destdir)/usr/bin/*-gcc-$(base_version).* - for f in c++ g++ gcc gcc-ar gcc-nm gcc-ranlib; do \ - rm -f $(destdir)/usr/bin/$${f}-$(base_version); \ - mv $(destdir)/usr/bin/*-$${f}-$(base_version) \ - $(destdir)/usr/bin/$(target)-$$(printf '%s' \ - $(destdir)/usr/bin/*-$${f}-$(base_version) | \ - sed "s/^.*-\($${f}\)/\1/"); \ + rm -f $(destdir)/usr/bin/$(target_gnu)-* + for f in $(destdir)/usr/bin/*; do f="$${f##*/}"; \ + mv $(destdir)/usr/bin/$${f} $(destdir)/usr/bin/$(target)-$${f};\ done libdir=/usr/lib/$(target) && \ rm -Rf \ |