############################################################################# # (c) 版权所有 IBM Corp. 2007 保留所有权利。 # # 以下源代码示例("示例")归国际组织所有 # Business Machines Corporation 或其子公司之一(" IBM "),并且是 # 拥有版权和许可,不得出售。 您可以使用、复制、修改和 # 在不向 IBM 支付费用的情况下,以任何形式分发样品,目的是 # 协助您开发应用程序。 # # 样本代码是在 "原样 "的基础上提供给您的,不保证 # 任何一种。 IBM 在此,本公司明确声明不作任何保证,无论是明示的还是 # 隐含保证,包括但不限于以下隐含保证 #适销性和特定用途的适用性。 一些辖区确实 # 本法不允许排除或限制默示保证,因此上述 # 限制或除外责任可能不适用于您。 IBM SHALL NOT BE LIABLE FOR # 因使用、复制、修改或 # 分发样品,即使 IBM 已被告知可能出现以下情况 # 此类损害赔偿。 ############################################################################# # # MAKEFILE for C++ sample on AIX # # 输入以下命令之一 # # make <app_name> - 生成 <app_name> 指定的程序 # make all - 生成所有提供的示例程序 # make srv - 生成服务器上运行的所有程序 # 包括例程(存储过程和 UDF) # make rtn - 生成所有例程(存储过程和 UDF) # make all_client - 联编所有客户端程序(所有程序都位于 # call_rtn 和 client_run 类别) # make call_rtn - 生成所有调用例程的客户端程序 # make client_run - 生成所有完全在 # 客户端(不是调用例程的客户端) # make clean - 删除所有在运行过程中生成的中间文件 # 生成过程 # make cleanall - 删除构建过程中生成的所有文件 # (除原始源文件外的所有文件) # # makefile 包含以下部分 # 1 -- 变量 # 2 -- 分类 # 3 -- 制作单个样本的命令 # # ############################################################################## # 1 -- 变量 ############################################################################## # 该文件假定 DB2 实例路径由变量 HOME 定义。 # 它还假定 DB2 安装在 DB2 实例下。 # 如果这些语句不正确,请更新变量 DB2PATH。 DB2PATH = $(HOME)/sqllib BLDAPP=bldapp BLDRTN=bldrtn BLDMC=bldmc BLDMT=bldmt # 连接到客户机上编录的远程 SAMPLE 数据库 # 使用另一个名称,更新 ALIAS 变量。 ALIAS=sample # 必要时设置 UID 和 PWD UID= PWD= # 连接到客户机上编录的远程 SAMPLE2 数据库 # 使用另一个名称,更新 ALIAS2 变量。 ALIAS2=sample2 # 必要时设置 UID2 和 PWD2 UID2=$(UID) PWD2=$(PWD) ERASE=rm -f ############################################################################# # 2 -- 分类 # 2a - make all (srv + all_client) # 2b - make srv # 2c - make rtn # 2d - make all_client (call_rtn + client_run) # 2e - make call_rtn # 2f - make client_run # 2g - 清理 # 2h - make cleanall ############################################################################# #**************************************************************************** # 2a - make all (srv + all_client) #**************************************************************************** all : \ srv\ 所有客户 #**************************************************************************** # 2b - make srv #**************************************************************************** srv : \ rtn \ dbcfg \ 启动 #**************************************************************************** # 2c - make rtn #**************************************************************************** rtn :\ spserver\ udfsrv udfemsrv #**************************************************************************** # 2d - make all_client (call_rtn + client_run) #**************************************************************************** all_client :\ call_rtn \ 客户端运行 #**************************************************************************** # 2e - make call_rtn #**************************************************************************** call_rtn :\ spclient\ udfcli \ udfemcli #**************************************************************************** # 2f - make client_run #**************************************************************************** client_run :\ cli_info clisnap clisnapnew \ dbauth dbconn dbcreate dbhistfile dbinfo dbinline dbinspec\ dblogconn dblognoconn\ dbmcon dbupgrade dbpkg dbrestore dbrollfwd\ dbsample dbsnap dbsnapnew dtformat dbthrds dbuse \ dtlob dtstruct dtudt \ evm fnuse \ inattach inauth ininfo insnap insnapnew \ tbbast tbcompress tbconstr tbcreate tbident tbinfo tbintrig \\ tbloadcursor tbmerge tbmod tbmove tbonlineinx tbpriv tbread tbreorg\ tbrunstats tbsavept tbsel tbtemp \ tbtrig tbumqt tbunion tscreate #**************************************************************************** # 2g - 清理 #**************************************************************************** 清洁 $(ERASE) *.o $(erase) *.del *.txt *.msg $(ERASE) dbauth.C dbcfg.C dbconn.C dbhistfile.C $(ERASE) dbinline.C dbinspec.C $(ERASE) dblogconn.C dblognoconn.C $(ERASE) dbmcon.C dbmcon1.C dbmcon2.C $(ERASE) dbpkg.C dbrestore.C dbrollfwd.C $(ERASE) dbsample.C dbthrds.C dbuse.C $(ERASE) dtformat.C dtlob.C dtstruct.C $(ERASE) dtudt.C $(ERASE) evm.C fnuse.C $(ERASE) inauth.C $(ERASE) spclient.C spserver.C $(ERASE) tbast.C tbcompress.C tbconstr.C tbcreate.C tbident.C $(ERASE) tbinfo.C tbintrig.C tbloadcursor.C tbmerge.C tbmod.C $(ERASE) tbmove.C tbonlineinx.C tbpriv.C tbread.C tbreorg.C $(ERASE) tbrunstats.C tbsavept.C tbsel.C tbtemp.C tbtrig.C $(ERASE) tbumqt.C tbunion.C $(ERASE) tscreate.C $(ERASE) udfcli.C udfemcli.C utilemb.C #**************************************************************************** # 2h - make cleanall #**************************************************************************** cleanall : \ 清除 $(ERASE) *.bnd $(ERASE) cli_info clisnap clisnapnew $(ERASE) dbauth dbcfg dbconn dbcreate dbhistfile $(ERASE) dbinline dbinfo dbinspec $(ERASE) dblogconn dblognoconn $(ERASE) dbmcon dbmcon1 dbmcon2 $(ERASE) dbupgrade dbpkg dbrestore dbrollfwd $(ERASE) dbsample dbsnap dbsnapnew dbthrds dbuse $(ERASE) dtformat dtlob dtstruct dtudt $(ERASE) evm $(ERASE) fnuse $(ERASE) inattach inauth ininfo insnap insnapnew instart $(ERASE) spclient spserver $(ERASE) tbast tbcompress tbconstr tbcreate tbident tbinfo $(ERASE) tbintrig tbloadcursor tbmerge tbmod tbmove tbonlineinx $(ERASE) tbpriv tbread tbreorg tbrunstats tbsavept tbsel tbtemp $(ERASE) tbtrig tbumqt tbunion $(ERASE) tscreate $(ERASE) udfcli udfsrv $(ERASE) udfemcli udfemsrv $(ERASE) $( DB2PATH )/function/udfsrv $(ERASE) $( DB2PATH )/function/udfemsrv $(ERASE) $( DB2PATH )/function/spserver ############################################################################# # 3 -- 制作单个样本的命令 # 3a - 常规样本,非嵌入式 SQL # 3b - 常规样本,嵌入式 SQL # 3c - 客户端/服务器样本 # 3d - 多重连接样本 # 3e - 多线程样本 ############################################################################# #**************************************************************************** # 3a - 常规样本,非嵌入式 SQL #**************************************************************************** cli_info : $(BLDAPP) cli_info Clisnap : $(BLDAPP) clisnap Clisnapnew : $(BLDAPP) clisnapnew dbcreate : $(BLDAPP) dbcreate dbinfo : $(BLDAPP) dbinfo dbupgrade : $(BLDAPP) dbupgrade dbsnap : $(BLDAPP) dbsnap dbsnapnew : $(BLDAPP) dbsnapnew inattach : $(BLDAPP) inattach ininfo : $(BLDAPP) ininfo insnap : $(BLDAPP) insnap insnapnew: $(BLDAPP) insnapnew 启动 $(BLDAPP) 启动 #**************************************************************************** # 3b - 常规样本,嵌入式 SQL #**************************************************************************** dbauth : $(BLDAPP) dbauth $(ALIAS) $(UID) $(PWD) dbcfg : $(BLDAPP) dbcfg $(ALIAS) $(UID) $(PWD) dbconn : $(BLDAPP) dbconn $(ALIAS) $(UID) $(PWD) dbhistfile: $(BLDAPP) dbhistfile $(ALIAS) $(UID) $(PWD) dbinline: $(BLDAPP) dbinline $(ALIAS) $(UID) $(PWD) dbinspec: $(BLDAPP) dbinspec $(ALIAS) $(UID) $(PWD) dblogconn: $(BLDAPP) dblogconn $(ALIAS) $(UID) $(PWD) dblognoconn: $(BLDAPP) dblognoconn $(ALIAS) $(UID) $(PWD) dbpkg : $(BLDAPP) dbpkg $(ALIAS) $(UID) $(PWD) dbrestore: $(BLDAPP) dbrestore $(ALIAS) $(UID) $(PWD) dbrollfwd: $(BLDAPP) dbrollfwd $(ALIAS) $(UID) $(PWD) dbsample : $(BLDAPP) dbsample $(ALIAS) $(UID) $(PWD) dbuse : $(BLDAPP) dbuse $(ALIAS) $(UID) $(PWD) dtformat : $(BLDAPP) dtformat $(ALIAS) $(UID) $(PWD) dtlob : $(BLDAPP) dtlob $(ALIAS) $(UID) $(PWD) dtstruct : $(BLDAPP) dtstruct $(ALIAS) $(UID) $(PWD) dtudt : $(BLDAPP) dtudt $(ALIAS) $(UID) $(PWD) evm : $(BLDAPP) evm $(ALIAS) $(UID) $(PWD) fnuse : $(BLDAPP) fnuse $(ALIAS) $(UID) $(PWD) inauth : $(BLDAPP) inauth $(ALIAS) $(UID) $(PWD) tbast : $(BLDAPP) tbast $(ALIAS) $(UID) $(PWD) tbcompress : $(BLDAPP) tbcompress $(ALIAS) $(UID) $(PWD) tbconstr : $(BLDAPP) tbconstr $(ALIAS) $(UID) $(PWD) tbcreate : $(BLDAPP) tbcreate $(ALIAS) $(UID) $(PWD) tbident : $(BLDAPP) tbident $(ALIAS) $(UID) $(PWD) tbinfo : $(BLDAPP) tbinfo $(ALIAS) $(UID) $(PWD) tbintrig : $(BLDAPP) tbintrig $(ALIAS) $(UID) $(PWD) tbloadcursor : $(BLDAPP) tbloadcursor $(ALIAS) $(UID) $(PWD) tbmerge : $(BLDAPP) tbmerge $(ALIAS) $(UID) $(PWD) tbmod : $(BLDAPP) tbmod $(ALIAS) $(UID) $(PWD) tbmove : $(BLDAPP) tbmove $(ALIAS) $(UID) $(PWD) tbonlineinx : $(BLDAPP) tbonlineinx $(ALIAS) $(UID) $(PWD) tbpriv : $(BLDAPP) tbpriv $(ALIAS) $(UID) $(PWD) tbread : $(BLDAPP) tbread $(ALIAS) $(UID) $(PWD) tbreorg : $(BLDAPP) tbreorg $(ALIAS) $(UID) $(PWD) tbrunstats : $(BLDAPP) tbrunstats $(ALIAS) $(UID) $(PWD) tbsavept : $(BLDAPP) tbsavept $(ALIAS) $(UID) $(PWD) tbsel : tbselinit $(BLDAPP) tbsel $(ALIAS) $(UID) $(PWD) tbtemp : $(BLDAPP) tbtemp $(ALIAS) $(UID) $(PWD) tbtrig : $(BLDAPP) tbtrig $(ALIAS) $(UID) $(PWD) tbumqt : $(BLDAPP) tbumqt $(ALIAS) $(UID) $(PWD) tbunion : $(BLDAPP) tbunion $(ALIAS) $(UID) $(PWD) tscreate : $(BLDAPP) tscreate $(ALIAS) $(UID) $(PWD) #**************************************************************************** # 3c - 客户端/服务器样本 #**************************************************************************** spclient : $(BLDAPP) spclient $(ALIAS) $(UID) $(PWD) spserver : $(BLDRTN) spserver $(ALIAS) spcat udfcli : $(BLDAPP) udfcli $(ALIAS) $(UID) $(PWD) udfsrv : $(BLDRTN) udfsrv udfemcli : $(BLDAPP) udfemcli $(ALIAS) $(UID) $(PWD) udfemsrv : $(BLDRTN) udfemsrv $(ALIAS) #**************************************************************************** # 3d - 多重连接样本 #**************************************************************************** dbmcon : $(BLDMC) dbmcon $(ALIAS) $( ALIAS2 ) $(UID) $(PWD) $( UID2 ) $( PWD2 ) #**************************************************************************** # 3e - 多线程样本 #**************************************************************************** dbthrds : $(BLDMT) dbthrds $(ALIAS) $(UID) $(PWD)