#*****************************************************************
#**                                                             **
#**             (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:		"@(#)Makefile	1.5 10/26/92 09:28:42 LLNL "

#
#	Make ELROS runtime/lib
#

#
# Note:  this make file should only be invoked by make files above
# this one in the ELROS tree.
#
# The following macro must be appropriately defined.
#
#   RO_TASKING_FLAG - NO__RO_TASKING or __RO_TASKING
#

include ../../Make.Defaults

#
# Files
#
DISTFILES=	Makefile

LIBELFILES=	libel-main.a libel-task.a libelros.a libback.a 

#
# Targets
#
libelros.a:	$(RO_TASKING_FLAG)

#
# Multi-tasking version of the library
#
__RO_TASKING:	libel-main.a libel-task.a
	$(RM) libelros.a
	$(CP) libel-main.a libelros.a
	$(AR) x libel-task.a
	$(AR) ruc libelros.a *.o
	$(RM) *.o
	$(IFEXISTS) $(RANLIB) $(IFSTATUS); $(THEN) $(RANLIB) libelros.a; $(FI) 
	$(TOUCH) $@

#
# Single-tasking version of the library
#
NO__RO_TASKING:	libel-main.a
	$(RM) libelros.a
	$(CP) libel-main.a libelros.a
	$(IFEXISTS) $(RANLIB) $(IFSTATUS); $(THEN) $(RANLIB) libelros.a; $(FI) 
	$(TOUCH) $@

#
# Housekeeping targets
#
new:	clean
	$(RM) *__RO_TASKING

clean:
	$(RM) $(LIBELFILES)

#
# For the "package" target, the following macro must be defined as a 
# command line argument.
#
#    RO_DIST_DIR - directory where distribution files are to be copied
#
package: $(DISTFILES)
	$(CP) -p $(DISTFILES) $(RO_DIST_DIR)


#
# For the "install" target, the following macro must be appropriately
# defined.
#
#   RO_INSTALL_DIR - directory where installed files should be copied
#
MY_INSTALL_DIR=	$(RO_INSTALL_DIR)/runtime/lib

install: $(DISTFILES) $(MY_INSTALL_DIR)
	$(RM) $(MY_INSTALL_DIR)/*
	$(FOR) i in $(DISTFILES); $(DO) ( \
		$(CP) $$i $(MY_INSTALL_DIR); \
		$(CHMOD) 444 $(MY_INSTALL_DIR)/$$i; \
	); $(DONE)

