#
# $Id: Makefile.in,v 2.0 1998/10/14 22:54:23 hender Exp $
#
# Makefile for the PBS src directory
#
# First, read the manual!
#
# To build PBS:
#	1. Follow the direction in the Makefile one directory level above.
#
#	2. In general, it is is best to make everything from the level above,
#	   at least the first time.
#
#	3. Once the objects have been built one from the level above, any
#	   subtree can be rebuilt at its own level by typing "./make build"
# 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_head@
@mk_dirs@

GUI = @GUI@
SCHD_DIR = @SCHD_CODE_SUBDIR@

PGM_DIR = server iff cmds resmom mom_rcp tools $(SCHD_DIR) $(GUI)
ALL_PGM_DIR = server iff cmds resmom mom_rcp tools scheduler.* gui

CLEAN_SUBDIRS = $(ALL_PGM_DIR) lib include

INST_SERVER_SUBDIRS = server $(SCHD_DIR)
INST_MOM_SUBDIRS = resmom mom_rcp
INST_CLIENTS_SUBDIRS = cmds tools iff lib include $(GUI)
INST_SUBDIRS = @INST_SERVER_SUBDIRS@ @INST_MOM_SUBDIRS@ @INST_CLIENTS_SUBDIRS@

BLD_SERVER_SUBDIRS = server $(SCHD_DIR)
BLD_MOM_SUBDIRS = resmom mom_rcp
BLD_CLIENTS_SUBDIRS = cmds tools iff $(GUI)
BLD_LIBS = include lib
BLD_SUBDIRS =  @BLD_LIBS@ @BLD_SERVER_SUBDIRS@ \
               @BLD_MOM_SUBDIRS@ @BLD_CLIENTS_SUBDIRS@


all build install depend clean distclean::
	@# do the distclean here so the sequencing can be assured
	@# allow for empty subdir lists and abort make if any subdir fails
	@case $@ in \
	    all|depend|build) SDIRS="$(BLD_SUBDIRS)";; \
	    install)   SDIRS="$(INST_SUBDIRS)";; \
	    *clean)    SDIRS="$(CLEAN_SUBDIRS)";; \
	esac && \
	for d in $$SDIRS "" ; do \
	    if test -n "$$d"; then \
	        (cd $$d && echo Making $@ in $$d && $(MAKE) $@) || exit $$?; \
	    else true; fi; \
	done && \
	{ test $@ = distclean && \
	    ($(RM) Makefile; exit 0) > /dev/null 2>&1 || true; }

