#//////////////////////////////////////////////////////////////////////////
#
# Filename:	Makefile 
# Purpose:	This is the makefile for GUItenMark.  It will probably
#		work only with GNU make, and as far as compilers are 
#		concerned, is intended to be used with GNU gcc.
# Mods:		04/19/2008 RSB	Began.
#		05/09/2008 RSB	Added GUItenMark-macosx target for
#				cross-compilation.
#
#  Copyright 2008 Ronald S. Burkey <info@sandroid.org>
#
#  This file is part of GutenMark.
#
#  GutenMark 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.
#
#  GutenMark 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 GutenMark; if not, write to the Free Software
#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
# 	///////////////////////////////////////////////////////////
#				IMPORTANT NOTE!
#		This Makefile builds not only a Linux version 
#		of GUItenMark, but also Win32 and Mac OS X
#		versions of GUItenMark, and the Win32 and 
#		builds are done on a Linux box!  This
#		assumes that you have installed the Cross-Compiler
#		system of the "I'm Cross!" project (refer to
#		http://www.sandroid.org/imcross).  I'm sure 
#		that it's possible to build GUItenMark from 
#		within Windows or Mac OS X, but I've not tried
#		it, and I'm sure this Makefile (while correct in
#		spirit) won't work in Windows or Mac OS X as-is, 
#		and I don't care to offer any advice on the matter.
#		Linux is free, IMCROSS is free, so use them.
#	///////////////////////////////////////////////////////////
#
#//////////////////////////////////////////////////////////////////////////


APPLIST=GUItenMark GUItenMark.exe GUItenMark-macosx
CSOURCE=main.cpp GUItenMark.cpp
CHEADERS=GUItenMark.h

.phony:  default
default: ${APPLIST}

.phony:  clean
clean:
	-rm ${APPLIST}

GUItenMark:  ${CSOURCE} ${CHEADERS} Makefile
	g++ \
		`wx-config --cxxflags` \
		${CSOURCE} \
		`wx-config --libs` \
		-o $@
	strip $@

GUItenMark.exe:  ${CSOURCE} ${CHEADERS} Makefile
	i386-mingw32-g++ \
		`${IMCROSS_PATH}/i386-mingw32/bin/wx-config --cxxflags` \
		${CSOURCE} \
		`${IMCROSS_PATH}/i386-mingw32/bin/wx-config --libs` \
		-o $@
	i386-mingw32-strip $@

GUItenMark-macosx:  ${CSOURCE} ${CHEADERS} Makefile
	powerpc-apple-darwin8-g++ \
		-arch i386 -arch ppc -isysroot ${IMCROSS_PATH}/mac/SDKs/MacOSX10.4u.sdk \
		`${IMCROSS_PATH}/mac/bin/wx-config --static --cxxflags` \
		${CSOURCE} \
		`${IMCROSS_PATH}/mac/bin/wx-config --static --libs` \
		-o $@
	powerpc-apple-darwin8-strip $@


