#
# top-level PVM3 makefile
#
# targets:
#  s: src - pvmd3, libpvm3.a
#  c: console - pvm
#  f: fortran lib - libfpvm3.a
#  g: groups - pvmgs, libgpvm3.a
#  l: manual page links
#  e: examples
#  m: xep example
#

PVM_ARCH	=	UNKNOWN
LIBDIR	=	lib/$(PVM_ARCH)
TOPBINDIR	=	bin
BINDIR	=	$(TOPBINDIR)/$(PVM_ARCH)
SHELL	=	/bin/sh

default:	s c f g

all:	s c f g l e m

clean:
	- cd src; ../lib/aimk clean
	- cd console; ../lib/aimk clean
	- cd libfpvm; ../lib/aimk clean
	- cd pvmgs; ../lib/aimk clean
	- cd man; chmod 755 mkmanlinks; ./mkmanlinks -u
	- cd examples; ../lib/aimk clean
	- cd gexamples; ../lib/aimk clean
	- cd xep; ../lib/aimk clean

$(LIBDIR):
	- mkdir $(LIBDIR)

$(BINDIR):	$(TOPBINDIR)
	- mkdir $(BINDIR)

$(TOPBINDIR):
	- mkdir $(TOPBINDIR)

## build pvmd, libpvm ##
s:
	@ echo "building in src"
	cd src; ../lib/aimk install

s.hack:
	cd src.hack; ../lib/aimk install

## build libfpvm ##
f:
	@ echo "building libfpvm"
	cd libfpvm; ../lib/aimk install

## build groups ##
g:
	@ echo "building group server and library"
	cd pvmgs; ../lib/aimk install

## build pvm console ##
c:
	@ echo "building console"
	cd console; ../lib/aimk install

c.hack:
	cd console.hack; ../lib/aimk install

## build man page links ##
l:
	@ echo "making man page links"
	cd man; chmod 755 mkmanlinks; ./mkmanlinks

## build xep example ##
m:
	@ echo "building xep example"
	- cd xep; ../lib/aimk

## build example programs ##
e:
	@ echo "building examples"
	- cd examples; ../lib/aimk all
	- cd gexamples; ../lib/aimk all

