#
# $Id: Makefile.in,v 2.0 1998/10/14 23:09:16 hender Exp $
#
#
#       Makefile for the PBS "mom" routine
#
# This program is confidential and proprietary to MRJ Technology Solutions
# and may not be reproduced, published or disclosed to others without
# written authorization from MRJ.
# 
# Copyright (c) 1998 MRJ Technology Solutions, Inc. All Rights Reserved.
# 
# This program is derived from prior work some of which was originally
# written as a joint project between the Numerical Aerospace Simulation
# (NAS) Systems Division of NASA Ames Research Center and the National
# Energy Research Supercomputer Center (NERSC) of Lawrence Livermore
# National Laboratory.
#
# the first non-comment line must be .POSIX to assure POSIX make behavior
#
@MAKE_POSIX_TARGET@


srcdir = @srcdir@
top_srcdir = @top_srcdir@
MK_VPATH = @srcdir@:@srcdir@/../server:@srcdir@/$(PBS_MACH)
INSTALL = @INSTALL@

@mk_head@
@mk_dirs@

PBS_MKDIRS = $(SHELL) @top_builddir@/@PBS_MKDIRS@

INCS = -I../include -I$(top_srcdir)/src/include -I$(srcdir)/$(PBS_MACH)
CFLAGS = @CFLAGS@ $(INCS) @DEFS@ -DPBS_MOM -DDEMUX=\"$(DEMUX_PATH)\" \
	-DRCP_PATH=\"$(RCP_PATH)\"
MOMLIBS = @MOMLIBS@
MOM_ADDTL_OBJS = @MOM_ADDTL_OBJS@

TARGET = pbs_mom

OBJS =	mom_main.o \
	mom_comm.o \
	mom_server.o \
	mom_inter.o \
	attr_recov.o \
	catch_child.o \
	dis_read.o \
	job_attr_def.o \
	job_func.o \
	job_recov.o \
	list_link.o \
	process_request.o \
	prolog.o \
	reply_send.o \
	requests.o \
	req_quejob.o \
	start_exec.o \
	resc_def_all.o \
	mom_mach.o \
	mom_start.o \
	pe_input.o \
	$(MOM_ADDTL_OBJS)


PBSLIBS	= ../lib/Libattr/libattr.a \
	  ../lib/Liblog/liblog.a \
	  ../lib/Libnet/libnet.a \
	  ../lib/Libpbs/libpbs.a \
	  ../lib/Libsite/libsite.a


all: autodepend
	@MAKE_POSIX_PLUS@@$(MAKE) build

build: $(TARGET)

install: build
	$(PBS_MKDIRS) mom
	$(PBS_MKDIRS) aux
	@$(INSTALL) -d -m 755 $(sbindir) && \
	$(INSTALL) -m 700 $(TARGET) $(sbindir)

pbs_mom: $(OBJS) $(PBSLIBS)
	$(CC) $(CFLAGS) -o $@ $(OBJS) $(PBSLIBS) $(LIBS) $(MOMLIBS)

@mk_cleanup@
@mk_tail@

