###############################################################################
#
#  Copyright (C) 1994 A. Bode, J. Pruyne and G. Stellner
#
#  This file is part of CoCheck
#
#  CoCheck is free software; you can redistribute it and/or
#  modify it under the terms of the GNU Library General Public
#  License as published by the Free Software Foundation; either
#  version 2 of the License, or (at your option) any later version.
#
#  CoChecl is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
#  Library General Public License for more details.
#
#  You should have received a copy of the GNU Library General Public
#  License along with this library; if not, write to the Free
#  Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
#  Contact to the authors:
#
#  electronic mail: {bode,stellner}@informatik.tu-muenchen.de
#
#  paper mail:      Prof. Dr. A. Bode
#                   Lehrstuhl f"ur Rechnertechnik und Rechnerorganisation
#                   Institut f"ur Informatik
#                   Technische Universit"at M"unchen
#                   80290 M"unchen
#                   Germany
#
###############################################################################
#
# Makefile,v
# 1995/11/17 13:59:10
# 1.5
# Exp
# stellner
#
# Authors: G. Stellner
#
# Description:
#
# Top level Makefile for CoCheck
#
###############################################################################
#
# rcs_id: "Makefile,v 1.5 1995/11/17 13:59:10 stellner Exp"
#

###############################################################################
# DO NOT MODIFY THIS FILE
###############################################################################

TOP          = .

include      $(TOP)/config/COMMON.config
include      $(TOP)/config/$(PVM_ARCH).config

MAKEOPTS     = \
		-f $(PVM_ROOT)/conf/$(PVM_ARCH).def \
		-f Makefile
CPPFLAGS     = \
		-DDEBUG \
		$(ARCHCPPFLAGS)
#-DSTOPAFTERRST \
OPTIONS      = \
		-g \
		$(ARCHOPTIONS)

all:  $(PVM_ROOT)/conf $(BINDIR) $(LIBDIR) rensym getpvmlib
	@ for i in $(CCDIRS); \
	  do ( \
	    	cd $$i; \
		echo "Making in $$i"; \
		$(MAKE) $(MAKEOPTS) all \
			"ARCHCPPFLAGS=$(CPPFLAGS)" \
			"OPTIONS=$(OPTIONS)" \
			"TOP=$(TOP)/.." \
			"MAKE=$(MAKE)"; \
	  ) done

$(PVM_ROOT)/conf:
	@ echo "Install PVM in $(PVM_ROOT) before continuing"
	@ [ -d $@ ]

clean:
	- cd src; $(MAKE) clean \
			"TOP=$(TOP)/.." \
			"MAKE=$(MAKE)"

realclean:
	@-for i in $(SUBDIRS); \
	  do ( \
		cd $$i; \
		$(MAKE) $(MAKEOPTS) realclean \
			"TOP=$(TOP)/.." \
			"MAKE=$(MAKE)"; \
	  ) done
	- rm -rf $(BINDIR)

$(LIBDIR):
	- mkdir $(LIBDIR)

$(BINDIR):
	- mkdir -p $(BINDIR)

rensym:
	@ echo "Making in tools"
	@ cd tools;\
	  $(MAKE) $(MAKEOPTS) first \
		"ARCHCPPFLAGS=$(CPPFLAGS)" \
		"OPTIONS=$(OPTIONS)" \
		"TOP=$(TOP)/.." \
		"MAKE=$(MAKE)"

getpvmlib:
	@ echo "Making in lib"
	@ cd lib; $(MAKE) $(MAKEOPTS) all \
		"TOP=$(TOP)/.." \
		"MAKE=$(MAKE)"



