# $Id: Makefile,v 1.2 90/07/11 13:09:37 mbp Exp Locker: mbp $

# Master makefile for graphics part of Hypercad and Interface

####################################################################
# Configuration section

# PWD = complete pathname of the dir containing this makefile.  If you
# are using csh this should be set automatically by the shell.
# Otherwise, remove the comment char from the next line and append the
# complete pathname of this dir.
# PWD = 

# BINDIR = dir in which to install executable files.  This is used by
# 'make install'.  By default (as this Makefile is distributed),
# executables are placed in a subdir of this dir called 'bin'.  If you
# want to put them somewhere else, change the def here, preferably to
# a dir which is on your search path.
BINDIR = $(PWD)/bin

# HELPDIR = dir in which to install help file.  The help file is
# needed at run-time.  To have the program compiled so that it uses
# the copy of the help file in the source code, set
# HELPDIR=$(PWD)/hgraphics/sunview.  You may change HELPDIR to any
# existing directory name. 'make' will compile the program so that it
# looks in that dir for the helpfile at run-time, and 'make install'
# will put a copy of the helpfile in that dir.  DO NOT COMMENT OUT THE
# DEF OF HELPDIR.  If you do, the program will not be able to find the
# help file.
HELPDIR=$(PWD)/Hypercad/hgraphics/sunview

# SPOOL_COMMAND = command to use for printing PostScript files.  If
# you can't print PostScript files, comment out this def.
SPOOL_COMMAND=lpr

# OPTIONS = compiler options
OPTIONS=-O

# CP = copying command for use in installation. Should be 'ln' or 'cp'.
CP=ln

# End configuration section --- don't change anything below here
####################################################################

INSTALL_BIN = $(PWD)/../instl

MAKE_OPTIONS = \
  BINDIR="$(BINDIR)" \
  HELPDIR="$(HELPDIR)" \
  SPOOL_COMMAND="$(SPOOL_COMMAND)" \
  OPTIONS="$(OPTIONS)" \
  CP="$(CP)"

####################################################################

all:	compile_hypercad compile_interface

compile_hypercad:
	cd Hypercad ; \
	$(MAKE) \
	  PWD="$(PWD)/Hypercad" \
	  $(MAKE_OPTIONS)

compile_interface:
	cd Interface ; \
	$(MAKE) \
	  PWD="$(PWD)/Interface" \
	  $(MAKE_OPTIONS)

install_quietly:	$(BINDIR) install_hypercad install_interface

install:	install_quietly
	@echo ''
	@echo 'Installation of the graphics part of Hypercad is now'
	@echo 'complete. The executable files for the graphics host'
	@echo 'are in the directory'
	@echo '     $(BINDIR)'
	@echo ''


$(BINDIR):
	mkdir $(BINDIR)

install_hypercad:
	cd Hypercad ; \
	$(MAKE) \
	  PWD="$(PWD)/Hypercad" \
	  $(MAKE_OPTIONS) \
	  install

install_interface:
	cd Interface ; \
	$(MAKE) \
	  PWD="$(PWD)/Interface" \
	  $(MAKE_OPTIONS) \
	  install

localclean:
	/bin/rm -f *~ ;

clean:	localclean
	cd Hypercad ; $(MAKE) clean
	cd Interface ; $(MAKE) clean

veryclean:	localclean
	cd Hypercad ; $(MAKE) veryclean
	cd Interface ; $(MAKE) veryclean

distclean:	localclean
	/bin/rm -r -f ./bin
	cd Hypercad ; $(MAKE) distclean
	cd Interface ; $(MAKE) distclean

