
#**********************************************************************#
#*                                                                    *#
#* Copyright (c) 2001 by Sun Microsystems, Inc.                       *#
#* All rights reserved.                                               *#
#*                                                                    *#
#**********************************************************************#



# This makefile should be used to generate demo programs for Sybase
#
# The makefile may be invoked in the following manner:
#
# make clean (To clean up)
#
# make all (To compile all demo programs )
#
# ***********************************************
# rules
# ***********************************************
# -----------------------------------------------------------------------
# If you are using 4.9x sybase, make sure to set COBPC to cobpc
# rather than cobpre
# -----------------------------------------------------------------------
COBPC=cobpre
# -----------------------------------------------------------------------
# If you are using 4.9x sybase, make sure to set the SYBFLAGS to -T
# -----------------------------------------------------------------------
SYBFLAGS=-C mf_word
.SUFFIXES:	.c .int .o .cbl .cob .clt .cop .bth .bms .map

.cbl.int:
	rm -f $*.int $*.idy
	$(COBOL) $(COBFLAGS) -C $(COBOPT) $<

.cob.int:
	rm -f $*.int $*.idy
	$(COBOL) $(COBFLAGS) -C $(COBOPT1) $<

.clt.cbl:
	kixclt $*.clt

.cop.clt:
	$(COBPC) $(SYBFLAGS) -O$*.clt $*.cop 

.bth.cob:
	$(COBPC) $(SYBFLAGS) -O$*.cob $*.bth 

.bms.map:
	kixbms -c $*.bms

# ***********************************************
# variables to rules
# ***********************************************

#
# Invoke Cobol command.
#

COBOL=cob

#
# Default Cobol flag settings (none).
#

COBFLAGS= -ia

# cobol option for online programs 
COBOPT="cics ibmcomp noalter notrunc defaultbyte=0 ans85" 

# cobol option for batch programs 
COBOPT1="ibmcomp noalter notrunc defaultbyte=0 ans85" 
# ***********************************************
# standard variables
# ***********************************************

INCDIR=$SYBASE/include
#
# This directory is the target for the user executable files.
#

all:	ACCTBTCH.int ish/jobsyb

ACCTBTCH.int:	ACCTBTCH.bth	ACCTBTCH.cob

ish/jobsyb: jmvs/jobsyb $(FILEMAP)
	haltrans jobsyb -fs

clean:
	rm -f ACCTBTCH.cob ACCTBTCH.i*
	rm -f *.lis *.err *.log *.bad
	rm -f ish/jobsyb
