XCOMM
XCOMM    Copyright (c) 1992 Minnesota Supercomputer Center, Inc.
XCOMM    Copyright (c) 1992 Army High Performance Computing Research Center
XCOMM        (AHPCRC), University of Minnesota
XCOMM    Copyright (c) 1995-1999 Laboratory for Computational Science and
XCOMM        Engineering (LCSE), University of Minnesota
XCOMM
XCOMM    This is free software released under the GNU General Public License.
XCOMM    There is no warranty for this software.  See the file COPYING for
XCOMM    details.
XCOMM
XCOMM    See the file CONTRIBUTORS for a list of contributors.
XCOMM
XCOMM    Orignal author(s):
XCOMM      Ken Chin-Purcell <ken@ahpcrc.umn.edu> 
XCOMM
XCOMM    This file is maintained by:
XCOMM      Grant Erickson <grant@lcse.umn.edu>
XCOMM
XCOMM    Module name: Imakefile
XCOMM
XCOMM    Description:
XCOMM      Imakefile for GVL tools
XCOMM

#define IHaveSubdirs
#define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)'

SHELL		= /bin/sh

MAJORVERSION	= 1
MINORVERSION	= 3
UPDATELEVEL	= 0
STATUS		= b

PACKAGE		= AnimaBob
RELEASE		= $(MAJORVERSION).$(MINORVERSION).$(UPDATELEVEL)$(STATUS)

SUBDIRS		= util		\
		  lib		\
		  icol		\
		  animabob	\
		  doc		\
		  $(NULL)

all::
	@echo ""; \
	echo "In the future, please begin by using 'make build' if "; \
	echo "you are building $(PACKAGE) for the first time or "; \
	echo "'make rebuild' if you are rebuilding an existing tree."; \
	echo ""; \
	echo -n "Do you want to proceed? "
	@read INPUT; \
	case "$$INPUT" in \
	  [yY]*)\
	    echo -n "Do you want to 'build' or 'rebuild'? "; \
	    read INPUT; \
	    case "$$INPUT" in \
	      [bB]*)\
		make build; \
		exit 0; \
		;;\
	      [rR]*)\
		make rebuild; \
		exit 0; \
		;;\
	      *)\
		echo "Unknown option: $$INPUT"; \
		exit 1; \
		;; \
	    esac; \
	    ;;\
	  *)\
	    echo "Make aborted."; \
	    exit 0; \
	    ;;\
	esac

NamedMakeSubdirs(allsubdirs,$(SUBDIRS))

XCOMM
XCOMM Before doing 'make depend', be sure to have run 'make includes'.
XCOMM

DependSubdirs($(SUBDIRS))

build::
	@echo ""
	@echo -n "Building release $(RELEASE) of $(PACKAGE) on "
	@date
	@echo ""
	$(MAKE) $(MFLAGS) Makefiles
	$(MAKE) $(MFLAGS) clean
	$(MAKE) $(MFLAGS) includes
	$(MAKE) $(MFLAGS) depend
	$(MAKE) $(MFLAGS) $(GLOBALMAKEOPTS) allsubdirs
	@echo ""
	@echo ""
	@echo "Build of release $(RELEASE) of $(PACKAGE) complete."
	@echo ""

rebuild::
	@echo ""
	@echo -n "Rebuilding release $(RELEASE) of $(PACKAGE) on "
	@date
	@echo ""
	$(MAKE) $(MFLAGS) includes
	$(MAKE) $(MFLAGS) depend
	$(MAKE) $(MFLAGS) $(GLOBALMAKEOPTS) allsubdirs
	@echo ""
	@echo ""
	@echo "Rebuild of release $(RELEASE) of $(PACKAGE) complete."
	@echo ""
