#***************************************************************************
#*   Copyright (C) 2006 by Dave Parker                                     *
#*   drparker@freenet.co.uk                                                *
#*                                                                         *
#*   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 2 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, write to the                         *
#*   Free Software Foundation, Inc.,                                       *
#*   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
#***************************************************************************/

CC=gp2x-g++
AR=gp2x-ar
# CC=g++
# AR=ar

OBJS=screen.o app.o image.o font.o input.o colour.o button.o

all: libgp2xsdl.a

libgp2xsdl.a: $(OBJS)
	rm -f libgp2xsdl.a
	$(AR) cr libgp2xsdl.a $(OBJS)

screen.o: screen.cpp screen.h colour.h
	$(CC) -c `sdl-config --cflags` screen.cpp

app.o: app.cpp app.h impl.h input.h
	$(CC) -c `sdl-config --cflags` app.cpp

image.o: image.cpp image.h screen.h
	$(CC) -c `sdl-config --cflags` image.cpp

font.o: font.cpp font.h screen.h
	$(CC) -c `sdl-config --cflags` font.cpp

input.o: input.cpp input.h button.h
	$(CC) -c `sdl-config --cflags` input.cpp

colour.o: colour.cpp colour.h screen.h
	$(CC) -c `sdl-config --cflags` colour.cpp

button.o: button.cpp button.h
	$(CC) -c `sdl-config --cflags` button.cpp


clean:
	rm -f libgp2xsdl.a
	rm -f *.o
