SHELL = /bin/sh

#=============================================================================
#
#  INSTALL_DIR   --- Root directory into which the product is to be installed.
#  INSTALL_FILES --- Names of the files to be installed.
#  CLEAN_FILES   --- Names of specific files to be deleted when the directory
#                    is cleaned.  Files matching one of a default set of file
#                    name templates will be deleted automatically
#                    (i.e., *~ core *.bak *.orig *.old .#* #*# *.o).  This
#                    variable is for declaring additional files to delete which
#                    don't match any of the file name templates.
#
#  For example, for the product "mySch":
#     INSTALL_DIR   = $(MYSCH_DIR)
#     INSTALL_FILES = $(BOOK).dvi $(BOOK).ps
#     CLEAN_FILES   = *.log *.toc *.aux $(BOOK).dvi \
#                     $(BOOK).ps
#
#=============================================================================

INSTALL_DIR	= $(TS_DIR)
INSTALL_FILES	= *.ps
CLEAN_FILES	=

#=============================================================================
#
# You will have to edit the rest of this file, if you want DVI and postscript
# book versions of your online help.
#
#=============================================================================

WWW  = ./www/
BOOK = ts

#===========================================================================
# STANDARD TARGETS
#===========================================================================

default:
	@echo Please invoke this makefile using sdssmake. >&2
	@exit 1

all :
	(cd www; echo In www; $(MAKE) $(MFLAGS) all );

install :
	@if [ "$(INSTALL_DIR)" = "" ]; then \
		echo You have not specified a destination directory >&2; \
		exit 1; \
	fi     
	@ rm -rf $(INSTALL_DIR)/doc
	@ mkdir $(INSTALL_DIR)/doc
	@if [ "$(INSTALL_FILES)" != "" ]; then \
		cp $(INSTALL_FILES) $(INSTALL_DIR)/doc; \
		chmod 644 $(INSTALL_DIR)/doc/*; \
	fi
	(cd www; echo In www; $(MAKE) $(MFLAGS) install)

clean :
	rm -f $(CLEAN_FILES) *~ core *.bak *.orig *.old .#* #*#
	(cd www; echo In www; $(MAKE) $(MFLAGS) clean );

#===========================================================================
# TARGETS
#===========================================================================

#
# Generate TeX
#
#
#       The Book
#

$(BOOK).dvi : $(BOOK).tex
	-latex $(BOOK).tex
	-latex $(BOOK).tex

$(BOOK).ps : $(BOOK).dvi
	-dvips $(BOOK) -o $(BOOK).ps

# Remove likely artifacts of building, but not the desirata 
tidy:
	rm -f *.log *.toc *.aux
	rm -f *~ core *.bak *.orig *.old .#* #*#
