#*****************************************************************
#**                                                             **
#**             (C) Copyright 1992 the Regents of the           **
#**        University of California.  All Rights Reserved.      **
#**                                                             **
#**        This work was produced under the sponsorship of      **
#**         the U.S. Department of Energy.  The Government      **
#**                retains certain rights therein.              **
#**                                                             **
#**                         Written by                          **
#**         Distributed Programming Environments Project        **
#**           Computer Software and Networking Division,        **
#**                   Livermore Computer Center,                **
#**            Lawrence Livermore National Laboratory           **
#**                                                             **
#*****************************************************************

#	sccsid:		"@(#)Makestub	1.16 10/26/92 09:40:42 LLNL "

#
# 	Test ELROS library routines, STUBbed versions
#
# The following macro must be defined on the command line for all
# tests:
#
#   TEST - the prefix of the test file (.ec file) to execute
#
# The following macros may be defined on the command line to select the 
# ELROS system (driver, preprocessor, runtime) that you want to test.
# The default values are read from ../Make.Defaults.
#
#   RO_DIR - path name to the ELROS system to test
#   RO_SWITCHES - Command line arguments to C and ECC to use
#
#   ECC - Path name to driver to test, if not in $(RO_DIR)/driver
#
# The following macros need to be defined on the command line for some
# tests:
#
#   OUT - .out file to use for comparison of output
#   AUX - .in files to read
#   EXTRAS - .i files (interface specifications) to use
#

include ../Make.Defaults

#
# Local macros
#
OUT=	complete.out

#
# Paths and files
#
R=	$(RO_DIR)/runtime
I=	$(R)/include/elros/

INCLUDES=       $(I)preprocessor.h $(I)instance.h $(I)sem.h		\
		$(I)exceptions.h $(I)typeinfo.h $(I)messages.h		\
		$(I)oidtree.h $(I)SENDP_element.h $(I)typeforms.h	\
                $(I)typetags.h $(I)typecodes.h $(I)typecmps.h		\
		$(I)typecopies.h $(I)typeconsts.h $(I)functiondefs.h	\
		$(I)binds.h $(I)shared_decls.h

STUBS=	$(R)/STDbind_STUB.o $(R)/STUBisode.o $(R)/STUBsock.o $(R)/STUBtasking.o


#
# Targets
#
all:	diff1 finis

dat:	diff2 finis

dat2:	diff3 finis

log:	difflog finis

finis:
	$(RM) $(TEST).ex $(TEST).ec..o $(TEST).OUT 
	$(RM) $(TEST).DAT* $(TEST).*LOG
	$(TOUCH) $(TEST)

diff1:	$(TEST).ex $(OUT)
	$(TEST).ex $(TEST).DAT > $(TEST).OUT
	$(DIFF) $(TEST).OUT $(OUT)

diff2:	diff1 $(TEST).dat
	$(DIFF) $(TEST).DAT $(TEST).dat

diff3:	$(TEST).ex $(OUT)
	$(TEST).ex $(TEST).DAT1 $(TEST).DAT2 > $(TEST).OUT
	$(DIFF) $(TEST).OUT $(OUT)

difflog:$(TEST).ex $(OUT)
	$(TEST).ex $(TEST).DAT > $(TEST).OUT
	$(DIFF) $(TEST).OUT $(OUT)
	../util/logging/logfilter -a $(TEST).LOG > $(TEST).NEWLOG
	$(DIFF) $(TEST).NEWLOG $(TEST).log

$(TEST).ex:	$(TEST).ec..o $(STUBS)
	$(ECC) $(RO_SWITCHES) $(TEST).ec..o $(STUBS) -o $(TEST).ex

$(TEST).ec..o:	$(TEST).ec $(AUX) $(EXTRAS)
	$(ECC) -c $(RO_SWITCHES) $(TEST).ec 

