#
# |-----------------------------------------------------------|
# | Copyright (c) 1991, 1990 MIPS Computer Systems, Inc.      |
# | All Rights Reserved                                       |
# |-----------------------------------------------------------|
# |          Restricted Rights Legend                         |
# | Use, duplication, or disclosure by the Government is      |
# | subject to restrictions as set forth in                   |
# | subparagraph (c)(1)(ii) of the Rights in Technical        |
# | Data and Computer Software Clause of DFARS 252.227-7013.  |
# |         MIPS Computer Systems, Inc.                       |
# |         950 DeGuigne Avenue                               |
# |         Sunnyvale, California 94088-3650, USA             |
# |-----------------------------------------------------------|
#
# $Header: Makefile,v 1.14.2.1 92/06/24 13:57:30 marker Exp $
#
SHELL	=/bin/sh

SUBDIRS	=nsl libmips libPW libaio libbsd libc libcrypt libcurses libdbm \
	libgen libl libmalloc libmalloccheck libsec librpcsvc \
	libsun libw liby libmutex

SPECLIST=libbsd libc
SPECARGS= LIBSUFFIX=_G0 GNUM="-G 0"

MIPS2LIST=libc
MIPS2ARGS= LIBSUFFIX=_mips2 ECFLAGS="-mips2 -DR6000" EASFLAGS="-mips2 -DR6000"

all clobber clean generic:
	@for dir in $(SUBDIRS) ;\
	{\
		if [ -d "$$dir" ] ;\
		then \
			echo "XXXXXXX $$dir XXXXXXX" ;\
			( cd $$dir ; $(MAKE) $(MAKEARGS) $@ ) ;\
		else \
			echo "******* No directory $$dir" ;\
		fi ;\
	}

install:
	@for dir in $(SUBDIRS) ;\
	{\
		if [ -d "$$dir" ] ;\
		then \
			echo "XXXXXXX $$dir XXXXXXX" ;\
			( cd $$dir ; $(MAKE) $(MAKEARGS) install ) ;\
		else \
			echo "******* No directory $$dir" ;\
		fi ;\
	}
	@for dir in $(SPECLIST) ;\
	{\
		if [ -d "$$dir" ] ;\
		then \
			echo "XXXXXXX $$dir (special) XXXXXXX" ;\
			( cd $$dir ; $(MAKE) clobber ;\
			  $(MAKE) $(MAKEARGS) $(SPECARGS) install ;\
			  $(MAKE) clobber ) ;\
		else \
			echo "******* No directory $$dir" ;\
		fi ;\
	}
	@for dir in $(MIPS2LIST) ;\
	{\
		if [ -d "$$dir" ] ;\
		then \
			echo "XXXXXXX $$dir (mips2) XXXXXXX" ;\
			( cd $$dir ; $(MAKE) clobber ;\
			  $(MAKE) $(MAKEARGS) $(MIPS2ARGS) install ;\
			  $(MAKE) clobber ) ;\
		else \
			echo "******* No directory $$dir" ;\
		fi ;\
	}
