#!/bin/bash #--------------------------------------------------------------------- # This script isn't used, under normal circumstances, except by devel- # opers of "mxe-minetest". # This script can be run, once and only once, after all "build" stages # are completed. # It turns the current "mxe-minetest" tree into something closer to # the structure that is distributed. # Warning: Execution of this script will delete part of what has been # built. Subsequently, the current tree will be "back to" something # similar to its original state. The "build" stages will need to be # done again. #--------------------------------------------------------------------- # Get absolute path for framework directory tree. BS=${BASH_SOURCE[0]} if [ -h $BS ]; then BS=`readlink $BS`; fi THISDIR="$( dirname $BS )" cd $THISDIR || exit 1 THISDIR=`pwd` #--------------------------------------------------------------------- if [ -f mxe.github.mk ]; then echo makedeliv.sh is running in $THISDIR else cat << END Error: Must run makedeliv.sh in the top-level "mxe-minetest" build-kit directory. END exit 1 fi #--------------------------------------------------------------------- rm -fr buildtmp rm -fr log rm -fr minetest-win* rm -fr tmp* rm -f *~ rm -f wget-* rm -f `find . -type f -name \*.exe` rm -f `find . -type f -name \*.so` for x in `find . -type d -name installed` do rm -f $x/* done #--------------------------------------------------------------------- bash -e stripfiles.sh || exit 1 #--------------------------------------------------------------------- rm -fr usr.new || exit 1 mkdir usr.new || exit 1 pushd usr || exit 1 for x in \ i686-w64-mingw32.static.posix \ x86_64-w64-mingw32.static.posix do if [ -d $x ]; then mv $x ../usr.new/ || exit 1 fi done popd || exit 1 rm -fr usr || exit 1 mv usr.new usr || exit 1 #--------------------------------------------------------------------- sed -e 's@^\(DEFAULT_MAX_JOBS *\):=.*@\1:= 4@' \ -e 's@^#* *\(MXE_TARGETS *:= *x86_64-.*posix\)$@ \1@' \ -e 's@^#* *\(MXE_TARGETS *:= *i686-.*posix\)$@# \1@' \ -e 's@^#* *\(MXE_TARGETS *:= *x86_64-.*osix i686.*osix\)$@# \1@' \ -i Makefile || exit 1 sed -e 's@^\(JOBS *\):=.*@\1:= 4@' \ -e 's@^#* *\(MXE_TARGETS *:= *x86_64-.*posix\)$@ \1@' \ -e 's@^#* *\(MXE_TARGETS *:= *i686-.*posix\)$@# \1@' \ -e 's@^#* *\(MXE_TARGETS *:= *x86_64-.*osix i686.*osix\)$@# \1@' \ -i settings.mk || exit 1 sed -e 's@^#* *\(THE_ARCH=x86_64-.*posix\)$@ \1@' \ -e 's@^#* *\(THE_ARCH=i686-.*posix\)$@# \1@' \ -i minetree/crossbuild-minetest.sh || exit 1