#*****************************************************************
#**                                                             **
#**             (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           **
#**                                                             **
#*****************************************************************

#	sccs_id: "@(#)Makefile	1.9 10/26/92 09:38:06 LLNL "

#
#	Make the ELROS logging utilities
#

# The following macro should be defined appropriately.
#
#   RO_SWITCHES - C compilation options
#

include ../../Make.Defaults

#
# Files
#
DISTFILES= loganal.c logfilter.c Makefile

INSTALLFILES=	loganal logfilter

#
# Targets
#
all:	showenv loganal logfilter
	@$(ECHOTEXT)
	@$(ECHOTEXT) $(BORDER)
	@$(ECHOTEXT) "Logging utilities are up to date"
	@$(ECHOTEXT) $(BORDER)

showenv:
	@$(ECHOTEXT)
	@$(ECHOTEXT) $(BORDER)
	@$(ECHOTEXT) "Making logging utilities"
	@$(ECHOTEXT)
	@$(ECHOTEXT) "RO_SWITCHES=$(RO_SWITCHES)"
	@$(ECHOTEXT) $(BORDER)
	@$(ECHOTEXT)

loganal:	loganal.c
	$(CC) $(CFLAGS) $(COPTS) loganal.c
	$(LD) -o loganal loganal.$(OSUFFIX) $(CLIBS)

logfilter:	logfilter.c
	$(CC) $(CFLAGS) $(COPTS) logfilter.c
	$(LD) -o logfilter logfilter.$(OSUFFIX) $(CLIBS)

new:	clean

clean:
	$(RM) $(INSTALLFILES)

#
# For the "package" target, the following macro must be defined as a
# command line argument.
#
#   RO_DIST_DIR - directory where the distribution files are to be copied
#
package:
	$(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)/util/logging

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