#	Makefile
#
#		This builds the UNIX resource compiler, a tool which
#	converts YAAF resources to a .cpp file.

########
#	RCompile - UNIX Resource compiler for YAAF Library
#	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:	rcompile rcompile_d
	cp rcompile /home/woody/bin/rcompile

clean:
	rm *.o
	rm rcompile
	rm rcompile_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	=	

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	=	
LFiles		=	

########
#	Contents

Sources		=	main.o \
				lex.o \
				RMenu.o \
				swap.o

Sources_d	=	main_d.o \
				lex_d.o \
				RMenu_d.o \
				swap_d.o


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

%.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

rcompile_d:		$(Sources_d)
	g++ -g -o rcompile_d $(Sources_d) $(LIncludes) $(LFiles)

rcompile:			$(Sources)
	g++ -o rcompile $(Sources) $(LIncludes) $(LFiles)
