#!/bin/sh
#
#        Copyright(C) 1997 Network Flight Recorder, Inc.
#        All rights reserved.
#
#        Use and distribution of this software and its source code
#        are governed by the terms and conditions of the
#        Network Flight Recorder Software License ("LICENSE.TXT")
#
# By Mark Sienkiewicz / NFR
#

what=$1

if [ "$what" = "" ]
then
	echo no subdirectories to make
	exit 0
fi

shift

keepgoing=0

case " $MAKEFLAGS "
in
" -k ")	keepgoing=1
	;;
" -i ")	keepgoing=1
	;;
esac


for x in $*
do
	if [ -d $x ] ; then
	    if ( cd $x ; echo '' ; echo 'Making in ' ; pwd ; make $what ; exit $? )
			then
				echo ''
			else
				case "$keepgoing"
				in
				1)
					;;
				0)
					exit 1
					;;
				esac
			fi
	else
	    echo Make in `pwd`/$x failed - no such directory
	fi
done
