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.
#  CFILES        --- C source files in ../../src with embedded HTML(sans .c)
#  SCRIPTS       --- TCL scripts in ../../etc with embedded HTML (sans .tcl)
#
#  For example, for the product "mySch":
#     INSTALL_DIR   = $(MYSCH_DIR)
#     INSTALL_FILES = *.html
#     CLEAN_FILES   = 
#     CFILES        = src1 src2
#     SCRIPTS       = proc1 proc2
#
#=============================================================================

INSTALL_DIR	= $(TARGET_INSTALL_DIR)
INSTALL_FILES	= *.html *.ps Makefile
CLEAN_FILES	= 
CFILES		= taTclDeclare target io quasars galaxies stars serendipity \
		  tclIO tclTarget calibrate tclCalibrate catalogs tclCatalogs \
		  standards rosat completetile tclCompletetile usno
SCRIPTS		= calib targetSelect taQsoSim taKObjMatch galaxiesParamsRead \
		  quasarsParamsRead serendipityParamsRead starsParamsRead \
		  standardsParamsRead rosatParamsRead

#=============================================================================
#
# You should not have to edit any of the rest of this file.
#
#=============================================================================

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

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

all :;
	@ for f in $(CFILES); do \
		c2html ../../src/$$f.c > $$f.html; \
	done
	@ for f in $(SCRIPTS); do \
		tcl2html ../../etc/$$f.tcl > $$f.html; \
	done

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

clean :
	rm -f $(CLEAN_FILES) *~ core *.bak *.orig *.old .#* #*#
	@ for f in $(CFILES); do rm -f $$f.html; done
	@ for f in $(SCRIPTS); do rm -f $$f.html; done
