]> Shamusworld >> Repos - virtualjaguar/blob - compile
Minor cleanup
[virtualjaguar] / compile
1 #! /bin/sh
2
3 #
4 # Compile script for Virtual Jaguar GCC/SDL Portable Jaguar Emulator
5 # This obviates the need for separate Makefiles for every OS architecture
6 # under the sun...
7 #
8 # by James L. Hammons
9 #
10 # If you have any parameters that you want to pass through to make, then
11 # simply add them to the 'compile' command line as if 'compile' were make.
12 #
13
14 echo
15 echo -n "*** Checking compilation environment... "
16
17 # Check for SDL
18
19 if [ "`which sdl-config`" = "" ]; then
20
21         echo
22         echo
23         echo "It seems that you don't have the SDL development libraries installed. If you"
24         echo "have installed them, make sure that the sdl-config file is somewhere in your"
25         echo "path and is executable."
26
27         exit 1
28
29 fi
30
31 echo -n "OK"
32
33 echo
34 echo -n "*** Compiling Virtual Jaguar for "
35
36 # Check the OS type...
37
38 if [ "$OSTYPE" = "msys" ]; then
39
40         echo -n Win32 on MinGW
41
42         SYSTYPE=__GCCWIN32__
43         EXESUFFIX=.exe
44         GLLIB=-lopengl32
45         ICON=vj-ico.o
46         SDLLIBTYPE=--libs
47 #This doesn't seem to make a difference on Win32...
48 #       SDLLIBTYPE=--static-libs
49
50 elif [ "$OSTYPE" = "darwin7.0" ] || [ "$OSTYPE" = "darwin" ]; then
51
52         echo -n Mac OS X
53
54         SYSTYPE=__GCCUNIX__ -D_OSX_
55         EXESUFFIX=
56         GLLIB=
57         ICON=
58         SDLLIBTYPE=--static-libs
59
60 else # *nix
61
62         echo -n generic Unix/Linux
63
64         SYSTYPE=__GCCUNIX__
65         EXESUFFIX=
66         GLLIB=-lGL
67         ICON=
68         SDLLIBTYPE=--libs
69
70 fi
71
72 echo ...
73 echo
74
75 export SYSTYPE EXESUFFIX GLLIB ICON SDLLIBTYPE
76
77 # Yes, you can pass through parameters to make...
78
79 make $@
80
81 if [ $? -eq 0 ]; then
82
83         echo
84         echo "*** Looks like it compiled OK... Give it a whirl!"
85         echo
86
87 fi