######################################################################### 
#									# 
#   File: scorpion/doc/examples/billing/Pascal/Makefile 
#				 					# 
#   Copyright (C) 1991 Richard Snodgrass
#									# 
#   The Scorpion System is free software in the public domain; you can  # 
#   redistribute it and/or modify it as you wish. We ask that you 	# 
#   retain credits referencing the University of Arizona and that you	# 
#   identify any changes you make.					# 
#									# 
#   Report problems to scorpion-project@cs.arizona.edu			# 
#   Direct all inquiries to:	The Scorpion Project			# 
#				Department of Computer Science		# 
#				Gould-Simpson Building			# 
#				University of Arizona			# 
#				Tucson, AZ 85721			# 
#				U.S.A.					# 
#									# 
#   Revision Log:							# 
#	$Log:$ 
#									# 
#   Edit Log:								# 
#									# 
######################################################################### 

# 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.p billing.h : ../billingproc.idl billing.idl
	$(IDLC) $(IDLCFLAGS) -nc $(IDLCFLAGSLOC) billing.idl

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

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