Store user data in $HOME
[kball.git] / fix.sh
blob26b6f507f3545551ac0f2e5672a95edfef41500a
1 #!/bin/sh
2 echo "KBall Source Code"
3 echo
4 echo "KBall's website: http://kball.sf.net/"
6 # REMEMBER TO ALTER THIS TEST TO SUIT YOUR NEEDS!!!
7 proc_test()
9 # You first need to configure the platform
10 if [ ! -e target.os ]; then
11 echo "Before test, you first must configure your platform."
12 proc_help;
13 else
14 echo Testing, please wait...
15 make test
17 if [ $? -eq 0 -a -e test.run ]; then
18 echo
19 echo "* SUCESS *"
20 echo "Congratulations, the test compiled!"
21 echo
22 echo "NOTE: You need Allegro 4.1.15 or better to compile KBall"
23 else
24 echo
25 echo "* ERROR *"
26 echo
27 echo "The compilation returned a error or can't be runned!"
28 echo "Check that:"
29 echo "(*) You have all compiler tools installed (gcc,make,etc...)"
30 echo "(*) You have Allegro 4.1.15 or better properly installed (http://alleg.sf.net/)"
31 echo "(*) You have DUMB 0.9.2 or better properly installed (http://dumb.sf.net/)"
32 echo
35 echo "Cleaning the test..."
36 make cleantest
37 fi
40 proc_help()
42 echo "Usage: fix platform"
43 echo
44 echo "Where platform is one of: djgpp, mingw32 or linux. "
45 echo
46 echo "NOTICE:"
47 echo "You can also call: fix test"
48 echo "to check if your system can compile this programs."
49 echo
50 echo "To compile KBall you need Allegro 4.1.15 or better, and DUMB 0.9.2 or better"
51 echo "http://alleg.sf.net/"
52 echo "http://dumb.sf.net/"
53 echo
56 proc_fix()
58 echo "Configuring for $1..."
60 if [ "$2" != "none" ]; then
61 echo "# Warning! This file will be overwritten by configuration routines!" > target.os
62 echo "TARGET=$2" >> target.os
67 # prepare for the given platform.
69 case "$1" in
70 "djgpp" ) proc_fix "DOS (djgpp)" "DJGPP";;
71 "mingw32" ) proc_fix "Windows (Mingw32)" "MINGW32";;
72 "linux" ) proc_fix "Linux (GCC)" "LINUX";;
73 "test" ) proc_test;;
74 "help" ) proc_help;;
75 * ) proc_help;;
76 esac
78 echo "Done!"