#//////////////////////////////////////////////////////////////////////////
# Filename:	Makefile
# Author:	Ron Burkey
# Purpose:	Makefile for Do178Builder.  The assumption is that GNU
#		make and gcc (or mingw32) are used.
# Mods:		09/30/01 RSB	Created.
#		10/21/01 RSB	Was just a single gcc command that compiled
#				and linked everything, regardless of whether
#				any of it had changed.  Put into a little
#				less primitive form.
#		02/18/02 RSB	Changed optimization to -O0.
#		11/10/03 RSB	Added the 'install' target.
#		06/21/05 RSB	Added the 'snapshot' target.  There are some
#				other minor tweaks as well, because I was 
#				having a very difficult time compiling, but
#				those can basically be ignored.
#		07/05/06 RSB	Modified to take advantage of the fact that
#				libold source code is now included rather
#				than built as a separate library.
#		03/09/08 RSB	Accounted for moved "ftp" directory.
#
#  Copyright 2001-2003,2005,2006,2008 Ronald S. Burkey
#
#  This file is part of Do178Builder.
#
#  Do178Builder 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.
#
#  Do178Builder 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 Do178Builder; if not, write to the Free Software
#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

#//////////////////////////////////////////////////////////////////////////

DATE:=`date +%Y%m%d`
WEBSITE:=~/Projects/sandroid.org/public_html/birdsproject/wasftp.birdsproject
OLDDIR=old-0.16

Do178Builder: \
	Do178Builder.o \
	Do178Builder_wdr.o \
	XmlEditorDialogClass.o \
	SearchBoxClass.o \
	LoadXmlFile.o \
	${OLDDIR}/lib/libold.o
	gcc --version
	gcc ${EXTRALIBS} `wx-config --libs` -g -o $@ $^
	
clean:	scrub Do178Builder

scrub:
	-rm Do178Builder
	-rm `find . -name "*.o"`
		
install: Do178Builder
	cp Do178Builder /usr/local/bin
	chmod ugo+x /usr/local/bin/Do178Builder	
	
snapshot: scrub
	tar --directory=.. --exclude="*/.snprj" --exclude="*/CVS" -czf ${WEBSITE}/Do178Builder-${DATE}-source.tar.gz Do178Builder-source
	ls -l ${WEBSITE}/*source.tar.gz -t -r
	
snapshot32:
	zip -j Do178Builder-${DATE}-win32.zip .template*xml Release/*exe 	
	
%.o:	%.cpp Do178Builder.h Do178Builder_wdr.h		
	gcc `wx-config --cppflags` -I${OLDDIR}/include -I${OLDDIR}/lib -Wall -c -g -o $@ $<
		
%.o:	%.c
	gcc -I${OLDDIR}/include -I${OLDDIR}/lib -Wall -c -g -o $@ $<	
