#***************************************************************************
#*   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++
LD=$(CC) -static
# CC=g++ -g
# LD=$(CC)
OBJS=main.o xword.o

all: ../2xworddata/2xword ../2xworddata/xgrep

../2xworddata/xgrep : xgrep.c
	$(CC) -o ../2xworddata/xgrep xgrep.c

../2xworddata/2xword: $(OBJS) ../libsrc/libgp2xsdl.a
	$(LD) -o ../2xworddata/2xword $(OBJS) -L../libsrc -lgp2xsdl `sdl-config --libs`

main.o: main.cpp
	$(CC) -c `sdl-config --cflags` -I../libsrc main.cpp

xword.o: xword.cpp xword.h 
	$(CC) -c `sdl-config --cflags` -I../libsrc xword.cpp

clean:
	rm -f ../2xworddata/2xword
	rm -f ../2xworddata/xgrep
	rm -f *.o
