Fixed Makefile
[kraptor.git] / fix.sh
blobb0a56fb0e3d94e932d141bec99f0cc2172721a68
1 #!/bin/sh
3 # Sets makefile source code for the different platforms
4 # Based on fix.sh of Allegro.
5 # Modified By Kronoman - In loving memory of my father.
7 echo "Kraptor Engine"
8 echo "--------------"
9 echo
10 echo "By Kronoman - In loving memory of my father"
11 echo
12 echo
15 # REMEMBER TO ALTER THIS TEST TO SUIT YOUR NEEDS!!!
16 proc_test()
18 # You first need to configure the platform
19 if [ ! -e target.os ]; then
20 echo "Before test, you first must configure your platform."
21 proc_help;
22 else
23 echo Testing, please wait...
24 make test
26 if [ $? -eq 0 -a -e test.run ]; then
27 echo
28 echo "* SUCESS *"
29 echo "Congratulations, the test compiled!"
30 echo
31 else
32 echo
33 echo "* ERROR *"
34 echo
35 echo "The compilation returned a error or can't be runned!"
36 echo "Check that:"
37 echo "(*) You have all compiler tools installed (gcc,make,etc)"
38 echo "(*) You have Allegro library properly installed (http://alleg.sf.net/)"
39 echo "(*) You have DUMB Music library properly installed (http://dumb.sf.net/)"
40 echo
43 echo "Cleaning the test..."
44 make cleantest
45 fi
48 proc_help()
50 echo "Usage: fix platform"
51 echo
52 echo "Where platform is one of: djgpp, mingw32 or linux. "
53 echo
54 echo "NOTICE:"
55 echo "You can also call: fix test"
56 echo "to check if your system can compile this programs."
57 echo
58 echo
61 proc_fix()
63 echo "Configuring for $1..."
65 if [ "$2" != "none" ]; then
66 echo "# Warning! This file will be overwritten by configuration routines!" > target.os
67 echo "TARGET=$2" >> target.os
72 # prepare for the given platform.
74 case "$1" in
75 "djgpp" ) proc_fix "DOS (djgpp)" "DJGPP";;
76 "mingw32" ) proc_fix "Windows (Mingw32)" "MINGW32";;
77 "linux" ) proc_fix "Linux (GCC)" "LINUX";;
78 "test" ) proc_test;;
79 "help" ) proc_help;;
80 * ) proc_help;;
81 esac
83 echo "Done!"