#
# If you compile on IBM S/390 you will need to :
# - use the binder i.s.o. the linker : 	_C89_STEPS=-1
# - remove the -lcl and -lm from the link list. It's not needed.
# - add the import library globlv62.x to the link list    
# - add the bpa import library /usr/lpp/bpa/lib/bpadll.x to the link list
# - use the next set of extra CFLAGS :
# 	-DEBCDIC -DIBM_OS390 
#	-Wc,dll -W"0,langlvl(extended)"
#	-D__STRING_CODE_SET__="ISO8859-1"
#
# The program will use ASCII strings and characters internally and files from the filesystem will be 
# translated from/to ebcdic by the translation module al_ebcdic.o, which is inside libalbsh.a
#

LD=${BSE}/api/lib
CFLAGS=-g -I${BSE}/api/include
LINKFLAGS=-g
CC=cc

BIC=bic6.2
BIC_CSTUB=bic_cstub6.2
BICFLAGS=
BICINCL=-I ${BSE}/gfd

all:	comment

comment:
	@echo ""
	@echo "To compile the example, run:"
	@echo ""
	@echo "make -f Makefile.HP"
	@echo "make -f Makefile.SUN"
	@echo "make -f Makefile.IBM"
	@echo "make -f Makefile.DEC"
	@echo "make -f Makefile.SIEMENS"
	@echo "make -f Makefile.SEQUENT"
	@echo ""
	@echo "depending on your (Operating) System"

ci_example:	ci_example.o c_src_dll.o
	${CC} ${LINKFLAGS} ci_example.o c_src_dll.o 	\
	${LD}/libci.a	\
	${LD}/libalbsh.a \
	${LD}/libipc.a	\
	${LD}/libtss.a	\
	${LD}/libyybsh.a \
	${LD}/libhal.a \
	${LD}/libtz.a \
	${LD}/libalbsh.a \
	-lm -o $@

ci_example.o:	ci_example.c
	${CC} -c ${CFLAGS} ci_example.c -o $@

c_src_dll.o:	c_src_dll.c
	${CC} -c ${CFLAGS} c_src_dll.c -o $@

c_src_dll.c:	qobj_dll
	${BIC_CSTUB} -s -d qobj_dll -o $@

qobj_dll:	src_dll
	${BIC} ${BICFLAGS} src_dll -o $@

clean:
	rm -f ci_example ci_example.o c_src_dll.o c_src_dll.c qobj_dll
