######################################################################### 
#									# 
#   File: scorpion/doc/examples/CandleXRef/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
BINDIR=/usr/local/scorpion/bin
LIBDIR=/usr/local/scorpion/lib
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
FILE=C

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

example : executables

Clean:
	$(RM) *.xcd *.tex

executables: attribute.xcd class.xcd allattr.xcd name.xcd

all: convert executables ${FILE}.idlreadspos displays

displays: att.tex class.tex allattr.tex name.tex

convert: underscore.convert
	rm -f lex.yy.c

underscore.convert : underscore.lex
	lex underscore.lex
	cc lex.yy.c -ll -o underscore.convert

att.tex:	attribute.xcd ${FILE}.idlreadspos
	time nice ${LIBDIR}/xref_interpreter attribute.xcd ${FILE}.idlreadspos \
		| underscore.convert > att.tex

attribute.xcd: attribute.xref
	${BINDIR}/xref -c attribute.xcd attribute.xref

class.tex: class.xcd ${FILE}.idlreadspos
	time nice ${LIBDIR}/xref_interpreter class.xcd ${FILE}.idlreadspos \
		| underscore.convert > class.tex

class.xcd: class.xref
	${BINDIR}/xref -c class.xcd class.xref

allattr.tex: allattr.xcd ${FILE}.idlreadspos
	time nice ${LIBDIR}/xref_interpreter allattr.xcd ${FILE}.idlreadspos \
		| underscore.convert > allattr.tex

allattr.xcd: allattr.xref
	${BINDIR}/xref -c allattr.xcd allattr.xref

name.tex: name.xcd ${FILE}.idlreadspos
	time nice ${LIBDIR}/xref_interpreter name.xcd ${FILE}.idlreadspos \
		| underscore.convert > name.tex

name.xcd: name.xref
	${BINDIR}/xref -c name.xcd name.xref

Candle.spos: Candle.Cdl
	${BINDIR}/candlewalk -v -S -r -o Candle.spos Candle.Cdl

CandleSyntax.spos: CandleSyntax.Cdl
	${BINDIR}/candlewalk -v -S -o CandleSyntax.spos CandleSyntax.Cdl

CandleSemantic.spos: CandleSemantic.Cdl CandleSyntax.Cdl
	${BINDIR}/candlewalk -v -S -r -o CandleSemantic.spos CandleSemantic.Cdl

CandleSemantic.idlreadspos: CandleSemantic.spos
	idlread < CandleSemantic.spos > CandleSemantic.idlreadspos

CandleList.spos: CandleList.Cdl CandleSyntax.Cdl
	${BINDIR}/candlewalk -v -S -r -o CandleList.spos CandleList.Cdl

CandleList.idlreadspos: CandleList.spos
	idlread < CandleList.spos > CandleList.idlreadspos
