##
# Copyright 1998-1999, University of Notre Dame.
# Authors: Jeffrey M. Squyres, Kinis L. Meyer, with M. D. McNally 
#          and Andrew Lumsdaine
#
# This file is part of the Notre Dame LAM implementation of MPI.
#
# You should have received a copy of the License Agreement for the
# Notre Dame LAM implementation of MPI along with the software; see
# the file LICENSE.  If not, contact Office of Research, University of
# Notre Dame, Notre Dame, IN 46556.
#
# Permission to modify the code and to distribute modified code is
# granted, provided the text of this NOTICE is retained, a notice that
# the code was modified is included with the above COPYRIGHT NOTICE and
# with the COPYRIGHT NOTICE in the LICENSE file, and that the LICENSE
# file is distributed with the modified code.
#
# LICENSOR MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED.
# By way of example, but not limitation, Licensor MAKES NO
# REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY
# PARTICULAR PURPOSE OR THAT THE USE OF THE LICENSED SOFTWARE COMPONENTS
# OR DOCUMENTATION WILL NOT INFRINGE ANY PATENTS, COPYRIGHTS, TRADEMARKS
# OR OTHER RIGHTS.
#
# Additional copyrights may follow.
#
##	Ohio Trollius
##	Copyright 1997 The Ohio State University
##
##	$Id: Makefile,v 6.11 1999/07/26 03:20:19 jsquyres Exp $
##
##	Function:	- lamd
##			- kernel + internal processes
##

DEPTH   = ../../..

##
## global configuration
##
include $(DEPTH)/config.mk

##
## local configuration
##
VPATH	= ../../../otb/sys/lamd:../../../otb/sys/kernel: \
	  $(DEPTH)/share/kernel:$(DEPTH)/share/etc:$(DEPTH)/share/echod: \
	  $(DEPTH)/share/router:../../../otb/sys/router: \
	  $(DEPTH)/share/bufferd:../../../otb/sys/kenyad: \
	  $(DEPTH)/share/bforward:../../../otb/sys/flatd: \
	  ../../../otb/sys/filed:../../../otb/sys/loadd: \
	  ../../../otb/sys/dlo_inet:../../../otb/sys/dli_inet: \
	  $(DEPTH)/share/traced:../../../otb/sys/iod:$(DEPTH)/share/mpi
INCLUDE	= -I$(IDIR) -I../../../otb/sys/filed
DEFS	= -DTO_DLO_ACK=$(TO_DLO_ACK) -DTO_DLO_IDLE=$(TO_DLO_IDLE) \
	  -DTO_DLO_ESTIMATE=$(TO_DLO_ESTIMATE) -DDOMAXRESEND=$(DOMAXRESEND)
LCFLAGS = $(INCLUDE) $(DEFS)
LDFLAGS	= $(LIBBIND)

##
## modules and libraries
##
LIB	= -L$(OLDIR) -largs -ltstdio -ltrillium -lt -lmpi $(IMPI_LIB) $(SYSLIBS)
BIN	= lamd

KSRC	= couter.c kernelio.c kinner.c kiproc.c kkill.c kouter.c kenyad.int.c
TSRC	= kexit.c nrecv.c nsend.c rreq.c stub.c trillium.c
RSRC	= router.c rtdinit.lam.c
BFSRC	= bufferd.c
DISRC	= bootsockio.c di_bootagent.c di_bootcmd.c di_wait.int.c dli_inet.c 
DOSRC	= dlo_inet.c do_load.c do_intr.c do_wait.int.c
ESRC	= echod.c
BWSRC	= bforward.c
FLSRC	= flatd.c
LSRC	= loadd.c
PSRC	= kenyad.c pqcreate.c pqdetach.c pqdoom.c pqstate.c
FSRC	= fdesc.c fface.c filed.c fqclose.c fqf77.c fqlseek.c fqopen.c \
	  fqread.c fqsimplex.c fqstate.c fqwrite.c fqopenfd.c
TRSRC	= traced.c trbuf.c
IOSRC	= iod.c iod.int.c 
SRC	= $(KSRC) $(RSRC) $(BFSRC) $(DISRC) $(DOSRC) $(ESRC) $(BWSRC) \
	  $(FLSRC) $(LSRC) $(PSRC) $(FSRC) $(TRSRC) $(TSRC) $(IOSRC)

OBJ	= $(SRC:.c=.o)

all: $(BIN)

$(BIN): $(OBJ) $(OLDIR)/libt.$(LIBDEPSFX) \
		$(OLDIR)/libargs.$(LIBDEPSFX) \
		$(OLDIR)/libtrillium.$(LIBDEPSFX)  \
		$(OLDIR)/libtstdio.$(LIBDEPSFX) \
		$(OLDIR)/libmpi.$(LIBDEPSFX) \
		$(IMPI_LIB_FILE)
	$(CC) $(LDFLAGS) -o $(BIN) $(OBJ) $(LIB)

install: $(OBDIR)/$(BIN)

$(OBDIR)/$(BIN): $(BIN)
	$(INSTALL) -c -m $(EXEC_PERMS) $(BIN) $(OBDIR)

clean:
	$(RM) $(OBJ) $(BIN)

##
## depend:
##
include	$(DEPTH)/config/depend

##
## automatic dependencies and rules
##
include Depends

##
## handmade dependencies
##   
dlo_inet.o: $(DEPTH)/config.mk
