From 74b6031b46d3399c9f856a099d758ea88a40fdb9 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Fri, 26 Apr 2013 12:10:20 -0400 Subject: Add installnative & installcross targets to build. --- diff --git a/build b/build index 2e9dc20..c66c576 100755 --- a/build +++ b/build @@ -84,6 +84,13 @@ $(install_targets): build fincludedir="$${libsubdir}/finclude" \ toolexeclibdir="/usr/lib/$(target)" \ MULTIOSDIR= + if [ "x$(target)" = 'x$(OPK_HOST_ARCH)' ]; then \ + $(MAKE) -f ../build "installnative-$(target)"; \ + else \ + $(MAKE) -f ../build "installcross-$(target)"; \ + fi + +$(installnative_targets): # 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 \ @@ -192,9 +199,6 @@ $(install_targets): build gcc-$(base_version)-$(target) \ cpp-$(base_version)-$(target) \ g++-$(base_version)-$(target) \ - "; \ - if [ "x$(target)" = 'x$(OPK_HOST_ARCH)' ]; then \ - OPK_PACKAGES="$${OPK_PACKAGES} \ libgcc.1 \ libssp.0 \ libgomp.1 \ @@ -209,6 +213,26 @@ $(install_targets): build export OPK_PACKAGES; \ oh-installfiles -d "$(destdir)" +$(installcross_targets): + # 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/"); \ + done + oh-fixperms -d "$(destdir)" + oh-strip -d "$(destdir)" + OPK_PACKAGES="\ + gcc-$(base_version)-$(target) \ + cpp-$(base_version)-$(target) \ + g++-$(base_version)-$(target) \ + "; \ + export OPK_PACKAGES; \ + oh-installfiles -d "$(destdir)" + install: $(install_targets) # POSIX.1-2008: diff --git a/config b/config index 35b0eb8..6603113 100755 --- a/config +++ b/config @@ -18,7 +18,8 @@ main() PKG_TARGET_ARCH="${arch}" configure_build done >targets.mk - for stamp in configure build install; do + for stamp in configure build install \ + installnative installcross; do printf '%s_targets = \\\n' "${stamp}" \ >>targets.mk for arch in ${PKG_TARGETS}; do -- cgit v0.9.1