######################################################################### 
#									# 
#   File: scorpion/src/IDLinclude/Makefile 
#				 					# 
#   Copyright (C) 1991 Karen Shannon
#									# 
#   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:								# 
#     Jan 9 1985 (shannon) Created.					# 
#									# 
######################################################################### 

# IMPORTED VARIABLES
CAT=/bin/cat
CC=cc
IDLC=$(BINDIR)/idlc
PC=pc
CFLAGS=-I$(INCDIR)/C
IDLCFLAGS=
PFLAGS=
CP=cp
MV=mv
RM=rm -f
LEX=lex
MAKE=make
SED=sed
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

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

System	: IDLread.c

# order of inclusion of files in IDLread.c is important!
IDLread.c: IDLreadfunc.c tree.c tree.h parse.c parse.h tokens.c 
	$(CAT) IDLreadfunc.c tree.h tree.c parse.c tokens.c > tempfile
	$(SED) -f idlread.script tempfile >IDLread.c

tokens.c: tokens.l 
	$(LEX) tokens.l
	$(SED) -f tokens.script lex.yy.c > tokens.c

parse.c	: parse.y
	$(YACC) -d parse.y
	$(MV) y.tab.c parse.c
	sh -c 'cmp -s y.tab.h parse.h && $(RM) y.tab.h || $(MV) y.tab.h parse.h'

Install:
	$(RM) $(INCDEST)/C/IDLread.c
	$(CP) IDLread.c $(INCDEST)/C	

Clean:	
	$(RM) *.o core tempfile lex.yy.* y.tab.*

DelSrc :
	$(RM) *.c *.idl *.y *.h *.l
