# This is an OCEAN Makefile to build the Nelsis/release3 tree.
#
# This Makefile checks to see if you have set the $MACHINE variable. If so, it
# creates a subdirectory objects/$MACHINE. Then it executes an inferior make
# process in this subdirectory.
#
# All this is necessary to maintain a single integrated source/object tree for
# many different computer platforms without reverting to symbolic links.
#
#             ======> WARNING: this file needs GNU make <========
#                                              ^^^

OBJDIR      = objects/$(MACHINE)
MAKEFILE2   = Makefile2

default: all

all install clean: checkmachine $(OBJDIR)
	cd $(OBJDIR) ; $(MAKE) -f ../../$(MAKEFILE2) $(MAKEOVERRIDES) $@

checkmachine:
	@if [ "$(MACHINE)" = "" ] ; then echo ;\
	    echo ; echo ; \
	    echo "******************************************************" ; \
	    echo "PLEASE SET YOUR \$$MACHINE ENVIRONMENT VARIABLE FIRST..." ; \
	    echo "******************************************************" ; \
	    echo "For example, type this to your csh:" ; echo ; \
	    echo "     % setenv MACHINE hp800 ; make" ; echo ; \
	    exit 1 ; \
	 fi

$(OBJDIR):
	mkdir -p $@
