#RollCageX (fanmade clone of the original RollCage games)
#Copyright (C) 2009  "Soul Slinger" (on gorcx.net forum)
#
#This program is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation, either version 3 of the License, or
#(at your option) any later version.
#
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#
#GNU General Public License for more details.
#You should have received a copy of the GNU General Public License
#along with this program.  If not, see <http://www.gnu.org/licenses/>.


SOURCE = main.c shared.c graphics.c physics.c events.c loaders.c
LIBS   = sdl ode gl glu
ARGS   = -march=i686 -mtune=i686 -O2 -pipe -Wall

normal: $(SOURCE)
	gcc -o ../rcx main.c `pkg-config --cflags --libs $(LIBS)` $(ARGS)

#might cause ("nVidious") problems... :-P
static: $(SOURCE)
	gcc -o ../rcx main.c `pkg-config --static --cflags --libs $(LIBS)` -static $(ARGS)

#only use with a suitable port of gcc (MinGW, CygWin, etc)
win32-static: $(SOURCE)
	gcc -o ../rcx.exe main.c `sdl-config --static-libs --cflags --libs` `ode-config --cflags --libs` -lm -lopengl32 -lglu32 -static -lstdc++ -lwinmm -lgdi32 -Dwindows $(ARGS)

clean:
	-rm -f ../rcx ../rcx.static ../rcx.exe
