#
# $Id: Makefile.in,v 2.0 1998/10/14 22:47:09 hender Exp $
#
# 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@

# leave the next line alone, it controls making the table of contents
IFDOTOC=

DOCSRC = $(srcdir)/..
DOCTRG = .
TEXT   = $(DOCSRC)/admin/admin.ms
FONTS = $(DOCSRC)/doc_fonts
SOELIM = ../soelim

TEXT_OUT = pbs_admin_guide.txt
PS_OUT = pbs_admin_guide.ps

COMMON_TARGETS = $(DOCTRG)/toc.input
PS_TARGETS = $(COMMON_TARGETS) $(PS_OUT)
TEXT_TARGETS = $(COMMON_TARGETS) $(TEXT_OUT)

ALL_TARGETS = $(COMMON_TARGETS) $(PS_OUT) $(TEXT_OUT)



all: build

build: $(PS_TARGETS)

text: $(TEXT_TARGETS)

update_src: build text
	cp pbs_admin_guide.ps pbs_admin_guide.txt $(PBS_DIR)

pbs_admin_guide.ps: $(SOELIM) $(TEXT) $(DOCTRG)/toc.input \
	$(DOCSRC)/admin/sourcetree.pic \
	$(DOCSRC)/ers/release.ms \
	$(DOCSRC)/ers/rel_history.ms
	$(SOELIM) -d $(DOCSRC)/admin $(FONTS) $(TEXT) | $(TBL) | $(PIC) | $(ROFF) -ms | $(POSTPS) > pbs_admin_guide.ps

pbs_admin_guide.txt: $(TEXT) $(DOCTRG)/toc.input
	$(SOELIM) -d $(DOCSRC)/admin $(FONTS) $(TEXT) | $(TBL) | $(PIC) | $(ROFF) -ms -Tascii | col -b > pbs_admin_guide.txt

print:	pbs_admin_guide.ps
	$(PRTCMD) $(PRTFLG) pbs_admin_guide.ps

install:

distclean:: clean
	-/bin/rm -f Makefile

clean::
	-/bin/rm -f $(ALL_TARGETS) *.input

$(SOELIM): $(srcdir)/../soelim.c
	cd ..; $(MAKE) soelim

$(DOCTRG)/toc.input: $(TEXT)
	@echo Remaking Table of Contents, please wait ...
	@rm -f $(DOCTRG)/toc.input
	@touch $(DOCTRG)/toc.input
	$(SOELIM) -d $(DOCSRC)/admin $(FONTS) $(TEXT) | $(TBL) | $(ROFF) -ms -rI2 > /dev/null 2>>$(DOCTRG)/toc.input
	@echo TOC remake complete

$(ALL_TARGETS): $(SOELIM)

# The following go away in final product

spell::
	spell +local_spell main_body.ms
	
mailing::	pbs_admin_guide.ps encode.text
	compress -c pbs_admin_guide.ps | uuencode pbs_admin_guide.ps.Z > xxx
	cat encode.text xxx > pbs_admin_guide.ps.en
	rm xxx 

