#!/bin/bash -e
find . -name "Makefile.am" |\
    xargs grep ACLOCAL_AMFLAGS |\
    awk -F: '{print $1}' | sort -r | while read FN ; do

       dn=`dirname $FN`
       pushd $dn >/dev/null 2>&1
       echo "----------------- $dn --------------"
       automake --cygnus
       popd >/dev/null 2>&1
    done

