#	Makefile
#
#		This builds the X11R6 version of the YAAF Constructor

########
#	YAAF Constructor - Rapid application development for YAAF
#	Copyright (C) 1998 William Edward Woody
#
#	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.
#	
#	To contact the author, either e-mail me at woody@pandawave.com, 
#	or write to
#	
#	        William Edward Woody
#	        In Phase Consulting
#	        1545 Ard Eevin Avenue
#	        Glendale, CA 91202
#	
#	Or visit us on the web at http://www.pandawave.com

########
#	Makefile commands

all:	yc yc_d
	cp yc /home/woody/bin/yc

clean:
	rm *.o
	rm yc
	rm yc_d


########
#	Kick off with some interesting defintions
#
#		Define notes:
#
#			OPT_XWIN		Set to 1 to indicate to XConfig.h that
#							we're compiling to X Windows.
#			OPT_NATIVEORDER	Set to 1 if byte order same as network order
#							(Which is true on a 680x0 or MacPPC architecture)
#							Set to 0 if not. (Like under the 80x86)
#			OPT_HASBOOL		Set to 1 if the compiler supports 'bool'
#							Set to 0 will fake bool support

CIncludes	=	-I../../yaaflib/headers

CFlags_d	=	-DOPT_XWIN=1 -DOPT_NATIVEORDER=0 -DOPT_HASBOOL=1 -w -g

CFlags		=	-DOPT_XWIN=1 -DOPT_NATIVEORDER=0 -DOPT_HASBOOL=1 -w

CPPFlags_d	=	-DOPT_XWIN=1 -DOPT_NATIVEORDER=0 -DOPT_HASBOOL=1	\
				-fhandle-exceptions -frtti -w -g

CPPFlags	=	-DOPT_XWIN=1 -DOPT_NATIVEORDER=0 -DOPT_HASBOOL=1	\
				-fhandle-exceptions -frtti -w

LIncludes	=	-L/usr/X11R6/lib -L../../yaaflib/libs
LFiles		=	-lX11 -lSM -lICE

########
#	Contents

Sources		=	main.o \
				PredefTypes.o \
				TBackgroundView.o \
				TConstructorApp.o \
				TErrorForm.o \
				TErrorView.o \
				TFile.o \
				TItemListView.o \
				TListView.o \
				TProjectForm.o \
				TProjectView.o \
				TRectEditView.o \
				TResDocument.o \
				TViewDeclForm.o \
				TViewTypeForm.o \
				TViewTypeList.o \
				ViewTypeRecord.o \
				XOpenDialog.o \
				Inspector.o \
				res.o


Sources_d	=	main_d.o \
				PredefTypes_d.o \
				TBackgroundView_d.o \
				TConstructorApp_d.o \
				TErrorForm_d.o \
				TErrorView_d.o \
				TFile_d.o \
				TItemListView_d.o \
				TListView_d.o \
				TProjectForm_d.o \
				TProjectView_d.o \
				TRectEditView_d.o \
				TResDocument_d.o \
				TViewDeclForm_d.o \
				TViewTypeForm_d.o \
				TViewTypeList_d.o \
				ViewTypeRecord_d.o \
				XOpenDialog_d.o \
				Inspector_d.o \
				res_d.o


########
#	And how do I build stuff?

res.cpp: yaafcon.rdata yaafcon.rl yaafcon.bmp
	rcompile yaafcon.rl res.cpp

%.o: %.c
	g++ -c $(CFlags) $(CIncludes) $< -o $@

%.o: %.cpp
	g++ -c $(CPPFlags) $(CIncludes) $< -o $@

%_d.o: %.c
	g++ -c $(CFlags_d) $(CIncludes) $< -o $@

%_d.o: %.cpp
	g++ -c $(CPPFlags_d) $(CIncludes) $< -o $@


########
#	Build programs

yc_d:		$(Sources_d)
	g++ -g -o yc_d $(Sources_d) $(LIncludes) $(LFiles) -lyaaf_d

yc:			$(Sources)
	g++ -o yc $(Sources) $(LIncludes) $(LFiles) -lyaaf
