# -*- Makefile -*-
# $Id: Makefile,v 1.8 1998/04/17 12:23:18 miyazaki Exp $
#
# Copyright (C) 1996-1998 by Haruo Yokota, 
#	Japan Advanced Inst. of Sci. and Tech.,
#	1-1 Asahidai, Tatsunokuchi, Ishikawa 923-1292, Japan.
#

SHELL		= /bin/sh
RM		= /bin/rm -f

SUBDIRS		= server client

FLAGS_TO_PASS = \
	MAKE='$(MAKE)' \
	KLIC='$(KLIC)' \
	KLICFLAGS='$(KLICFLAGS)' \
	KLICDP='$(KLICDP)' \
	NKLIC='$(NKLIC)' \
	NKLICFLAGS='$(NKLICFLAGS)' \
	PARADEROOT='$(PARADEROOT)' \
	IOMODULE='$(IOMODULE)'
###
.PHONY:	all install.sun ncube install.ncube all-clean clean

all: sun

sun:
	@ for subdir in $(SUBDIRS); do \
	   echo "making $$subdir"; \
	   ( cd $$subdir && $(MAKE) $(FLAGS_TO_PASS) $@ ) || exit 1; \
	done

install.sun:
	@ for subdir in $(SUBDIRS); do \
	   echo "installing $$subdir"; \
	   ( cd $$subdir && $(MAKE) $(FLAGS_TO_PASS) $@ ) || exit 1; \
	done

ncube:
install.ncube:

###
all-clean:
	@ for subdir in $(SUBDIRS); do \
	   echo "cleaning $$subdir"; \
	   ( cd $$subdir && $(MAKE) $(FLAGS_TO_PASS) $@ ) || exit 1; \
	done

clean:
	@ for subdir in $(SUBDIRS); do \
	   ( cd $$subdir && $(MAKE) $(FLAGS_TO_PASS) $@) || exit 1; \
	done
