Skip to content

Instantly share code, notes, and snippets.

@richelbilderbeek
Last active December 20, 2015 12:09
Show Gist options
  • Save richelbilderbeek/6128956 to your computer and use it in GitHub Desktop.
Save richelbilderbeek/6128956 to your computer and use it in GitHub Desktop.
My favorite crosscompile script: it crosscompiles a Qt Creator .pro file using MXE and copies the result to ~/bin
#!/bin/bash
myqmake="../../Libraries/mxe/usr/i686-pc-mingw32/qt5/bin/qmake"
#Cleaning up
rm *.pro.user
rm Makefile
rm Makefile.*
rm -r release
rm -r debug
rm ui_*.h
rm qrc_*.cpp
rm moc_*.cpp
rm object_script*.*
for myprofile in `ls | egrep ".pro\>"`
do
mytarget=`echo $myprofile | sed "s/\.pro//"`
$myqmake $myprofile
if [ ! -e Makefile ]
then
echo "FAIL: $myqmake $myprofile"
fi
make
if [ -e ./release/$mytarget".exe" ]
then
echo $mytarget": SUCCESS"
cp ./release/$mytarget".exe" ~/bin/
else
echo $mytarget": FAIL"
fi
#Cleaning up
rm Makefile
rm Makefile.*
rm -r release
rm -r debug
rm ui_*.h
rm qrc_*.cpp
rm moc_*.cpp
rm object_script*.*
done #next .pro file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment