#!/bin/sh
# Usage : create_makefiles dir
# (to be run from toplevel directory)
# Will re-create all Makefiles in dir and its subdirs
# Needs create_makefile in the path.
#
# David Faure <faure@kde.org>

srcdir=`egrep '^srcdir *=' Makefile | sed -e "s#srcdir *= *##"`
 
( cd $srcdir ; find $1 -type d | sed -e 's,/$,,' ) | \
  while read a; do 
      if test -f "$srcdir/$a/Makefile.am"; then
      	 test -d "$a" || mkdir -p "$a"
         create_makefile "$a/Makefile"
      fi
  done

