######################################################################### 
#									# 
#   File: scorpion/src/idlc/test/Makefile 
#				 					# 
#   Copyright (C) 1991 Sundar Varadarajan
#									# 
#   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:								# 
#									# 
######################################################################### 

INCDIR=/usr/local/scorpion/include
LIBDIR=/usr/local/scorpion/lib
SPECSDIR=/usr/local/scorpion/src/specs
BINDIR=/usr/local/scorpion/bin

IDLC=$(BINDIR)/idlc
IDLCFLAGS=
RM=/bin/rm
SED=sed
MV=mv
MAKE=make

UTILITYVARS='AR=$(AR)' 'CC=$(CC)' 'IDLC=$(IDLC)' 'PC=$(PC)' 'CFLAGS=$(CFLAGS)' \
              'IDLCFLAGS=$(IDLCFLAGS)' 'PFLAGS=$(PFLAGS)' 'CP=$(CP)' \
              'MV=$(MV)' 'RM=$(RM)' 'LEX=$(LEX)' 'MAKE=$(MAKE)' \
              'YACC=$(YACC)' 'MACHINE=$(MACHINE)' 'SED=$(SED)' 'SHELL=$(SHELL)'\
              'LINT=$(LINT)' 'RANLIB=$(RANLIB)'

# locals
FILE=test.idl
FILEC=Test.c
FILECAN=test.Cdl
FILED=TestC.c
FILECD=dianatestC.idl
FILEG=TestP.p
FILECG=dianatestP.idl
CANDIR=$(SPECSDIR)/Candle
IDLCFLAGSLOC=-h -I$(CANDIR) -I$(SPECSDIR) -m -k -nc 

Checkout: Checkout1 Semtest.c Semtest.h Test.c Test.h
	$(SED) '1,10d' Test.c > Sem2test.c
	$(SED) '1,10d' Test.h > Sem2test.h
	$(RM) Test.h Test.c
	sh -c 'cmp -s Semtest.c Sem2test.c && cmp -s Semtest.h Sem2test.h && (echo "files Semtest.[ch] and Semtest2.[ch] agree"; exit 0) || (echo "*** IDL Translator Failed Installation Check"; echo "Semtest.[ch] and Semtest2.[ch] disagree "; exit 1)'
	cd $(SPECSDIR)/Diana.Revision4; \
	$(SED) '1,10d' correct_TestC.c > DianaTestC.c;\
	$(SED) '1,10d' correct_TestC.h > DianaTestC.h;\
	$(SED) '1,10d' TestC.c > Diana2TestC.c;\
	$(SED) '1,10d' TestC.h > Diana2TestC.h;\
	sh -c 'cmp -s DianaTestC.c Diana2TestC.c && cmp -s DianaTestC.h Diana2TestC.h && (echo "files DianaTestC.[ch] and Diana2TestC.[ch] agree"; echo "IDL Translator Passed Installation Check") || (echo "*** IDL Translator Failed Installation Check"; echo "DianaTestC.[ch] and Diana2TestC.[ch] disagree")'

Checkout1:
	$(RM) $(SPECSDIR)/Diana.Revision4/TestC.h
	cd $(SPECSDIR)/Diana.Revision4; $(MAKE)  $(UTILITYVARS) 'SPECSDIR=$(SPECSDIR)' 'BINDIR=$(BINDIR)' TestC.h

Semtest.c: correct_Test.c 
	$(SED) '1,10d' correct_Test.c > Semtest.c

Semtest.h: correct_Test.h
	$(SED) '1,10d' correct_Test.h > Semtest.h

test.Cdl: test.idl
	$(IDLC) $(IDLCFLAGS) $(IDLCFLAGSLOC) -C test.Cdl test.idl

Test.h Test.c: test.idl
	$(IDLC) $(IDLCFLAGS) $(IDLCFLAGSLOC) test.idl

Clean:
	$(RM) *.Cdl *.o core

.IGNORE:

