#! /bin/sh
exitstat=0

# The following if/fi block gives you flexibility in choosing the pathname
# for make(1).
if
	test "$1" != ""		# the make pathaname was passed as an argument
then
	MAKE="$1" ; export MAKE	# so use the pathname
	if
		test ! -x "$MAKE" # if the pathname is wrong, stop right now
	then
		echo "$MAKE does not exist as an executable file."
		exit 2
	fi
elif
	test ! -z "$MAKE"		# otherwise, check for environment variable
then
	if
		test ! -x "$MAKE"	# if the pathname is wrong, stop right now
	then
		echo "You have MAKE defined as an environment variable, but"
		echo "it does not exist as an executable file."
		exit 2
	fi
else
	MAKE=make ; export MAKE	# no variable, so let the user's path decide
fi

touch dummy.o
if
	$MAKE -f single_sfx.mk dummy 2>/dev/null | grep 'Prerequisite dummy\.o makes target dummy' > /dev/null 2>&1
then
	echo 'This version of make supports single-suffix rules'
else
	echo 'This version of make does not support single-suffix rules'
	exitstat=1
fi
rm -f dummy.o
exit $exitstat
