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

#########
#	YAAF - Yet another application framework
#	Copyright (C) 1997, 1998 William Edward Woody
#	
#	This library is free software; you can redistribute it
#   and/or modify it under the terms of the GNU Library
#   General Public License as published by the Free Software
#   Foundation; either version 2 of the License, or any
#   later version.
#   
#   This library is distributed in the hope that it will be
#   useful, but WITHOUT ANY WARRANTY; without even the implied
#   warranty of MERCHANTABIILITY or FITNESS FOR A PARTICULAR
#   PURPOSE. See the GNU Library General Public License for
#   more details.
#   
#   You should have received a copy of the GNU Library General
#   Public License along with this library; 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:	libyaaf.a libyaaf_d.a

clean:
	rm *.o
	rm *.a

debug:	libyaaf_d.a

release: libyaaf.a

########
#	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../headers

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

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

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

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

LIncludes	=	-L/usr/X11/lib
LFiles		=	-lX11 -lSM -lICE

############
#
#	Library sources
#

Sources		=	AppMain.o \
				Copyright_xwin.o \
				CursorUtil.o \
				DataUtil.o \
				Error.o \
				ParseBitmap.o \
				RectMath.o \
				Support.o \
				XGAbort.o \
				XGAppCore.o \
				XGAppCore_xwin.o \
				XGAppMultiWindow.o \
				XGAppSingleWindow.o \
				XGArgStream.o \
				XGArray.o \
				XGBroadcast.o \
				XGButton.o \
				XGCheckButton.o \
				XGCommandButton.o \
				XGControl.o \
				XGDialog.o \
				XGDialogView.o \
				XGDispatch.o \
				XGDocument.o \
				XGDraw.o \
				XGEditText.o \
				XGError.o \
				XGFocus.o \
				XGFont.o \
				XGForm.o \
				XGGroupBox.o \
				XGHandle.o \
				XGInlineEdit.o \
				XGListControl.o \
				XGListView.o \
				XGMenu.o \
				XGMenuBar.o \
				XGMenuPop.o \
				XGMenuView.o \
				XGPicture.o \
				XGPopControl.o \
				XGPopMenuView.o \
				XGPopWindow.o \
				XGPostError.o \
				XGPostUnixOSError.o \
				XGPreferences.o \
				XGPrinter.o \
				XGRadioButton.o \
				XGScrollBar.o \
				XGScrollView.o \
				XGSemaphore.o \
				XGSend.o \
				XGSizeArray.o \
				XGSlider.o \
				XGStaticText.o \
				XGStatusBar.o \
				XGString.o \
				XGStringList.o \
				XGThread.o \
				XGView.o \
				XGViewFactory.o \
				XGWindow.o \
				XGWindowFactory.o

Sources_d	=	AppMain_d.o \
				Copyright_xwin_d.o \
				CursorUtil_d.o \
				DataUtil_d.o \
				Error_d.o \
				ParseBitmap_d.o \
				RectMath_d.o \
				Support_d.o \
				XGAbort_d.o \
				XGAppCore_d.o \
				XGAppCore_xwin_d.o \
				XGAppMultiWindow_d.o \
				XGAppSingleWindow_d.o \
				XGArgStream_d.o \
				XGArray_d.o \
				XGBroadcast_d.o \
				XGButton_d.o \
				XGCheckButton_d.o \
				XGCommandButton_d.o \
				XGControl_d.o \
				XGDialog_d.o \
				XGDialogView_d.o \
				XGDispatch_d.o \
				XGDocument_d.o \
				XGDraw_d.o \
				XGEditText_d.o \
				XGError_d.o \
				XGFocus_d.o \
				XGFont_d.o \
				XGForm_d.o \
				XGGroupBox_d.o \
				XGHandle_d.o \
				XGInlineEdit_d.o \
				XGListControl_d.o \
				XGListView_d.o \
				XGMenu_d.o \
				XGMenuBar_d.o \
				XGMenuPop_d.o \
				XGMenuView_d.o \
				XGPicture_d.o \
				XGPopControl_d.o \
				XGPopMenuView_d.o \
				XGPopWindow_d.o \
				XGPostError_d.o \
				XGPostUnixOSError_d.o \
				XGPreferences_d.o \
				XGPrinter_d.o \
				XGRadioButton_d.o \
				XGScrollBar_d.o \
				XGScrollView_d.o \
				XGSemaphore_d.o \
				XGSend_d.o \
				XGSizeArray_d.o \
				XGSlider_d.o \
				XGStaticText_d.o \
				XGStatusBar_d.o \
				XGString_d.o \
				XGStringList_d.o \
				XGThread_d.o \
				XGView_d.o \
				XGViewFactory_d.o \
				XGWindow_d.o \
				XGWindowFactory_d.o


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

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

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

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

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


########
#	Build yaaf library

libyaaf.a:	$(Sources)
	ar -rc libyaaf.a $(Sources)
	cp libyaaf.a ../libs/libyaaf.a

libyaaf_d.a: $(Sources_d)
	ar -rc libyaaf_d.a $(Sources_d)
	cp libyaaf_d.a ../libs/libyaaf_d.a

