Created
August 10, 2016 05:55
-
-
Save shattered/29ed8a6d5452883d8532cc9928bc7b5f to your computer and use it in GitHub Desktop.
mame/mess build wrapper for 'git bisect run'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# build MESS driver, or all of MESS, for 'git bisect run', accounting | |
# for changes in build process. | |
# | |
gmakealways="-j7 NOWERROR=1 USE_QTDEBUG=0" | |
driver=$1 | |
binary=mess | |
noclean=$2 | |
grep -q 'ifdef DRIVERS' makefile; sd=$? | |
grep -q 'ifdef SOURCES' makefile; ss=$? | |
test -d src/mess; sm=$? | |
test -f src/mame/drivers/${driver}.c; sc=$? | |
if [ $sd -eq 0 -o $ss -eq 0 ]; then | |
binary=$driver | |
if [ $ss -eq 0 ]; then | |
if [ $sc -eq 0 ]; then | |
gmakeargs="SUBTARGET=$driver SOURCES=src/mame/drivers/${driver}.c" | |
else | |
gmakeargs="SUBTARGET=$driver SOURCES=src/mame/drivers/${driver}.cpp" | |
fi | |
else | |
if [ $sm -eq 0 ]; then | |
gmakeargs="SUBTARGET=$driver DRIVERS=src/mess/drivers/${driver}.c" | |
else | |
gmakeargs="SUBTARGET=$driver DRIVERS=src/mame/drivers/${driver}.c" | |
fi | |
fi | |
else | |
binary=mess | |
gmakeargs="SDL_INSTALL_ROOT=/usr TARGET=mess" | |
fi | |
rc=0 | |
test -n "$noclean" || gmake $gmakealways $gmakeargs clean | |
rm -f $driver ${driver}64 | |
gmake $gmakealways $gmakeargs || rc=125 | |
if [ $rc -eq 125 ]; then exit $rc; fi | |
if [ -x ${binary}64 ]; then | |
binary=${binary}64 | |
else | |
if [ '!' -x $binary ]; then | |
exit 125 | |
fi | |
fi | |
echo | |
echo run regression test on $binary here | |
echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment