summaryrefslogtreecommitdiff
path: root/stepmake
diff options
context:
space:
mode:
authorDavid Kastrup <dak@gnu.org>2012-03-19 20:18:16 +0100
committerDavid Kastrup <dak@gnu.org>2012-03-20 15:53:56 +0100
commit21315eff86cedc692b2b1ed999eafdf8dbd60ff5 (patch)
tree4a0f1faece8b63cf5356a0f8549f1ae3ccaee692 /stepmake
parent7a0c49b741de8aa998e17c310d7a4703d7b1712c (diff)
Don't copy GNUmakefile and *.make from within builddir to builddir
Diffstat (limited to 'stepmake')
-rw-r--r--stepmake/aclocal.m428
1 files changed, 26 insertions, 2 deletions
diff --git a/stepmake/aclocal.m4 b/stepmake/aclocal.m4
index f7f457926a..490e2066ef 100644
--- a/stepmake/aclocal.m4
+++ b/stepmake/aclocal.m4
@@ -417,9 +417,22 @@ EOF
exit 2
fi
+ abssrcdir="`cd $srcdir; pwd`"
+ absbuilddir="`pwd`"
for d in 2 3 4 ; do
for mf in `cd $srcdir ; find . -maxdepth $d -mindepth $d -name GNUmakefile`; do
- mkdir -p $(dirname $mf)
+ case "$abssrcdir" in
+ "$absbuilddir"/*)
+# source is below build directory, always copy
+ ;;
+ *)
+ case "$abssrcdir/${mf#./}" in
+ "$absbuilddir"/*)
+# find descended into build directory, don't copy
+ continue
+ esac
+ esac
+ mkdir -p ${mf%/*}
cat <<EOF | $PYTHON - > $mf
print 'depth=' + ('../' * ( $d-1 ) )
print 'include \$(depth)/config\$(if \$(conf),-\$(conf),).make'
@@ -428,7 +441,18 @@ print 'MODULE_INCLUDES += \$(src-dir)/\$(outbase)'
EOF
done
for mf in `cd $srcdir ; find . -maxdepth $d -mindepth $d -name '*.make' | grep -v config.make `; do
- mkdir -p $(dirname $mf)
+ case "$abssrcdir" in
+ "$absbuilddir"/*)
+# source is below build directory, always copy
+ ;;
+ *)
+ case "$abssrcdir/${mf#./}" in
+ "$absbuilddir"/*)
+# find descended into build directory, don't copy
+ continue
+ esac
+ esac
+ mkdir -p ${mf%/*}
cat <<EOF | $PYTHON - > $mf
print 'include \$(depth)/config\$(if \$(conf),-\$(conf),).make'
print 'include \$(configure-srcdir)/$mf'