#############################################################################
# (c) Copyright IBM Corp. 2007 All rights reserved.
#
# The following sample of source code (<93>Sample<94>) is owned by International
# Business Machines Corporation or one of its subsidiaries ("IBM") and is
# copyrighted and licensed, not sold. You may use, copy, modify, and
# distribute the Sample in any form without payment to IBM, for the purpose
# of assisting you in the development of your applications.
#
# The Sample code is provided to you on an "AS IS" basis, without warranty
# of any kind. IBM HEREBY EXPRESSLY DISCLAIMS ALL WARRANTIES, EITHER EXPRESS
# OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Some jurisdictions
# do not allow for the exclusion or limitation of implied warranties, so the
# above limitations or exclusions may not apply to you. IBM shall not be
# liable for any damages you suffer as a result of using, copying, modifying
# or distributing the Sample, even if IBM has been advised of the
# possibility of such damages.
#
#############################################################################
#
# MAKEFILE for C# samples
#
# Enter one of the following commands
#
#   nmake <app_name>     - Builds the program designated by <app_name>
#   nmake all            - Builds all supplied sample programs
#   nmake XML            - Builds all supplied XML sample programs
#   nmake srv            - Builds all programs that run on the server
#                          including UDFs and stored procedures
#   nmake rtn            - Builds all routines (UDFs and stored procedures)
#   nmake all_client     - Builds all client programs (all programs in the
#			                     call_rtn and client_run categories)
#   nmake call_rtn       - Builds all client programs that call routines 
#			                     (UDFs and stored procedures)
#   nmake client_run     - Builds all programs that run completely on the
#                          client (not ones that call routines or stored
#			                     procedures)
#   nmake clean          - Erases all intermediate files produced in the  
#			                     build process
#   nmake cleanall       - Erases all files produced in the build process
#                          (all files except the original source files)
#
# The makefile contains the following sections:
#    1 -- VARIABLES
#    2 -- MAKE CATEGORIES
#    3 -- COMMANDS TO MAKE INDIVIDUAL SAMPLES
#
#############################################################################

#############################################################################
#		1 -- VARIABLES
#############################################################################

BLDAPP=bldapp
BLDRTN=bldrtn
BLDXMLAPP=bldXMLapp

ERASE=del

#############################################################################
#  2 -- MAKE CATEGORIES
#		2a - nmake all (srv + all_client + XML)
#		2b - nmake srv
#		2c - nmake rtn
#		2d - nmake all_client (call_rtn + client_run)
#		2e - nmake call_rtn
#		2f - nmake client_run
#		2g - nmake clean
#		2h - nmake cleanall
#		2i - namke XML
#############################################################################
	
#****************************************************************************
#		2a - nmake all (srv + all_client + XML)
#****************************************************************************

all : \
	srv \
	all_client \
	XML

#****************************************************************************
#		2b - nmake srv
#****************************************************************************

srv : \
	rtn

#****************************************************************************
#		2c - nmake rtn
#****************************************************************************

rtn : \
	SpServer \
	UDFcli \
	EmpDetails

#****************************************************************************
#		2d - nmake all_client (call_rtn + client_run)
#****************************************************************************

all_client : \
	call_rtn \
	client_run 

#****************************************************************************
#		2e - nmake call_rtn
#****************************************************************************

call_rtn : \
	SpClient \
	UDFcli \
	SpReturn

#****************************************************************************
#		2f - nmake client_run
#****************************************************************************

client_run : \
	DbAuth \
	DbUse \
	DbDatAdp \
	DbDatMap \
	DbDsetCn \
	DbEvent \
	DbValue\
	DtLob \
	LCTrans \
	TbConstr \
	TbInfo \
	TbSel \
	TbUse \
	TbPriv \
	TbTrig \
	SpClient
	
#****************************************************************************
#		2g - nmake clean
#****************************************************************************

clean :
	-$(ERASE) *.BMP
	-$(ERASE) *.TXT
	-$(ERASE) *.tlb

#****************************************************************************
#		2h - nmake cleanall
#****************************************************************************

cleanall : \
       clean
       -$(ERASE) *.exe
       -$(ERASE) *.snk
       -$(ERASE) *.dll

#****************************************************************************
#		2i - nmake XML
#****************************************************************************

XML : \
	XmlIndex \
	XmlUniqueIndexes \
	XmlInsert \
	XmlUpAndDel \
	XmlRelToXmlDoc \
	XmlRelToXmlType \
	XmlRead \
	XmltoTable \
	XmlDecomposition \
	XmlSchema \
	XmlSimpleProc \
	XmlSimpleProcClient \
	XmlFlwor \
	XmlSQLXQuery \
	XmlXPath \
	XmlXQuery \
	XmlXQueryProc \
	XmlXQueryProcClient \

#############################################################################
#  3 -- COMMANDS TO MAKE INDIVIDUAL SAMPLES
#		3a -  standalone samples
#		3b -  client/server samples
#############################################################################

DbAuth :
	-$(BLDAPP) DbAuth

DbDatAdp :
	-$(BLDAPP) DbDatAdp

DbDatMap :
	-$(BLDAPP) DbDatMap

DbDsetCn :
	-$(BLDAPP) DbDsetCn

DbEvent :
	-$(BLDAPP) DbEvent

DbUse :
	-$(BLDAPP) DbUse

DbValue :
	-$(BLDAPP) DbValue

DtLob :
	-$(BLDAPP) DtLob

LCTrans :
	sn -k SubCOM.snk
	-$(BLDAPP) SubCOM
	sn -k RootCOM.snk
	-$(BLDAPP) RootCOM
	-$(BLDAPP) LCTrans

TbConstr :
	-$(BLDAPP) TbConstr

TbInfo :
	-$(BLDAPP) TbInfo

TbSel :
	-$(BLDAPP) TbSel

TbTrig :
	-$(BLDAPP) TbTrig

TbUse :
	-$(BLDAPP) TbUse

TbPriv :
	-$(BLDAPP) TbPriv

XmlIndex :
	-$(BLDXMLAPP) XmlUtil
	-$(BLDXMLAPP) XmlIndex

XmlUniqueIndexes :
	-$(BLDXMLAPP) XmlUtil
	-$(BLDXMLAPP) XmlUniqueIndexes

XmlInsert :
	-$(BLDXMLAPP) XmlUtil
	-$(BLDXMLAPP) XmlInsert

XmlUpAndDel :
	-$(BLDXMLAPP) XmlUtil
	-$(BLDXMLAPP) XmlUpAndDel

XmlRead :
	-$(BLDXMLAPP) XmlUtil
	-$(BLDXMLAPP) XmlRead

XmlRelToXmlDoc :
	-$(BLDXMLAPP) XmlUtil
	-$(BLDXMLAPP) XmlRelToXmlDoc

XmlRelToXmlType :
	-$(BLDXMLAPP) XmlUtil
	-$(BLDXMLAPP) XmlRelToXmlType

XmltoTable :
	-$(BLDXMLAPP) XmlUtil
	-$(BLDXMLAPP) XmltoTable

XmlDecomposition :
	-$(BLDXMLAPP) XmlUtil
	-$(BLDXMLAPP) XmlDecomposition

XmlSchema :
	-$(BLDXMLAPP) XmlUtil
	-$(BLDXMLAPP) XmlSchema

XmlFlwor :
	-$(BLDXMLAPP) XmlUtil
	-$(BLDXMLAPP) XmlFlwor

XmlSQLXQuery :
	-$(BLDXMLAPP) XmlUtil
	-$(BLDXMLAPP) XmlSQLXQuery

XmlXPath :
	-$(BLDXMLAPP) XmlUtil
	-$(BLDXMLAPP) XmlXPath

XmlXQuery :
	-$(BLDXMLAPP) XmlUtil
	-$(BLDXMLAPP) XmlXQuery

#****************************************************************************
#		   3b - client/server samples
#****************************************************************************

SpClient :
	-$(BLDAPP) SpClient

SpReturn :
	empcat
	-$(BLDAPP) SpReturn

UDFcli :
	-$(BLDAPP) UDFcli

SpServer :
	-$(BLDRTN) SpServer
	SpCat

UDFsrv :
	-$(BLDRTN) UDFsrv
	UDFCat

EmpDetails :
	empcat

XmlSimpleProc :
	-$(BLDXMLAPP) XmlUtil
	-$(BLDXMLAPP) XmlSimpleProc
	XmlSpCat

XmlSimpleProcClient :
	-$(BLDXMLAPP) XmlUtil
	-$(BLDXMLAPP) XmlSimpleProcClient

XmlXQueryProc :
	-$(BLDXMLAPP) XmlUtil
	-$(BLDXMLAPP) XmlXQueryProc
	XmlSpCatXQuery

XmlXQueryProcClient :
	-$(BLDXMLAPP) XmlUtil
	-$(BLDXMLAPP) XmlXQueryProcClient