#! /bin/sh

#echo 1>&2 $1

if [ "$1" = "" ]; then
	echo 'tAC_OUTPUT('
	echo 'v,'
	echo 'x,'
	echo 'z)'
fi

MAKEFILEAM="$1"Makefile.am

if [ ! -e "$MAKEFILEAM" ]; then MAKEFILEAM=/dev/null; fi

SUBDIRS=`sed -n '

/^[ \t]*SUBDIRS[ \t]*=/ {
s/^[ \t]*//
s/^SUBDIRS//
s/^[ \t]*//
s/^=//
s/[ \t]*$//p
}
' <$MAKEFILEAM`

for i in $SUBDIRS; do cinMakefile "$1$i/"; done

if [ "$1" = "po/" ]; then
	echo 'kud_GNU_GETTEXT'
	echo 'upo/Makefile.in'
	echo 'w[sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile]'
else
	echo 'u'"$1"'Makefile'
fi
