SleepIsDeath/configure

105 lines
1.7 KiB
Plaintext
Raw Permalink Normal View History

#!/bin/bash
#
# Modification History
#
# 2010-April-2 Andy Sommerville
# Allow menu choice from argv.
# "exit 1" when user chooses 'q'; terminate build.
#
# 2006-June-27 Jason Rohrer
# Copied/modified from Transcend project. Dropped a platforms that were only
# nominally supported.
#
if [[ "$1" < "4" ]] ; then
if [[ "$1" > "0" ]] ; then
platformSelection="$1"
fi
fi
while [ -z "$platformSelection" ]
do
echo "select platform:"
echo " 1 -- GNU/Linux"
echo " 2 -- MacOSX"
echo " 3 -- Win32 using MinGW"
echo " q -- quit"
echo ""
echo -n "> "
read platformSelection
if [ "$platformSelection" = "q" ]
then
exit 1
fi
# use ASCII comparison.
if [[ "$platformSelection" > "3" ]]
then
platformSelection=""
fi
if [[ "$platformSelection" < "1" ]]
then
platformSelection=""
fi
done
# use partial makefiles from minorGems project
makefileMinorGems="../minorGems/build/Makefile.minorGems"
makefileMinorGemsTargets="../minorGems/build/Makefile.minorGems_targets"
platformName="Generic"
platformMakefile="generic"
case "$platformSelection" in
"1" )
platformName="GNU/Linux"
platformMakefile="Makefile.GnuLinux"
;;
"2" )
platformName="MacOSX"
platformMakefile="Makefile.MacOSX"
;;
"3" )
platformName="Win32 MinGW"
platformMakefile="Makefile.MinGW"
;;
esac
rm -f Makefile.temp
echo "# Auto-generated by game7/configure for the $platformName platform. Do not edit manually." > Makefile.temp
rm -f gameSource/Makefile
cat Makefile.temp $platformMakefile Makefile.common $makefileMinorGems gameSource/Makefile.all $makefileMinorGemsTargets > gameSource/Makefile
rm Makefile.temp
exit