# file: doc/examples/billing/Pascal/Makefile

# IMPORTED VARIABLES
LIBDIR=/usr/local/scorpion/lib
BINDIR=/usr/local/scorpion/bin
INCDIR=/usr/local/scorpion/include/Pascal
CC=cc
IDLC=$(BINDIR)/idlc
PC=pc
CFLAGS=-I$(INCDIR)/C
IDLCFLAGS=
PFLAGS=
CP=cp
MV=mv
RM=rm -f
LEX=lex
MAKE=make
YACC=yacc
UTILITYVARS='CC=$(CC)' 'IDLC=$(IDLC)' 'PC=$(PC)' 'CFLAGS=$(CFLAGS)' \
	      'IDLCFLAGS=$(IDLCFLAGS)' 'PFLAGS=$(PFLAGS)' 'CP=$(CP)' \
	      'MV=$(MV)' 'RM=$(RM)' 'LEX=$(LEX)' 'MAKE=$(MAKE)' \
	      'YACC=$(YACC)'
CI=ci
CO=co -l

# LOCAL VARIABLES
LIB=$(LIBDIR)/libidlP.a
IDLCFLAGSLOC=-I.. -s4 -C billing.Cdl
IDLCHECK=$(BINDIR)/idlcheck

##################################################################

example: billing
	$(RM) customers.in transactions.in customers.out bills.out
	ln -s ../test/customers.in customers.in
	ln -s ../test/transactions.in transactions.in
#reads customers.in, transactions.in, creates customers.out, bills.out
	billing
	$(IDLCHECK) -v -C billing.Cdl  \
            customers_in customers.in \
            customers_out customers.out \
            bills_out bills.out \
            transactions_in transactions.in 2> idlcheck.out


billing : billing.o algorithm.o $(LIB)
	$(PC) $(PFLAGS) algorithm.o billing.o $(LIB) -o billing

billing.o : ../billingproc.idl billing.idl
	$(IDLC) $(IDLCFLAGS) $(IDLCFLAGSLOC)  billing.idl

algorithm.o: algorithm.p billing.h
	$(PC) $(PFLAGS) -c algorithm.p

Clean:
	$(RM) *.o billing billing.h billingFunctions.h billing.i \
		customers.out bills.out *.list
