Ensure private variables are not used when appending target-specific
[make.git] / tests / mkshadow
blobd41b40e1a313a8b89c84e35e7c9b8cc4a5dd26f8
1 #!/bin/sh
3 # Simple script to make a "shadow" test directory, using symbolic links.
4 # Typically you'd put the shadow in /tmp or another local disk
6 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
7 # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
8 # Foundation, Inc.
9 # This file is part of GNU Make.
11 # GNU Make is free software; you can redistribute it and/or modify it under
12 # the terms of the GNU General Public License as published by the Free Software
13 # Foundation; either version 3 of the License, or (at your option) any later
14 # version.
16 # GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
17 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
19 # details.
21 # You should have received a copy of the GNU General Public License along with
22 # this program. If not, see <http://www.gnu.org/licenses/>.
24 case "$1" in
25 "") echo 'Usage: mkshadow <destdir>'; exit 1 ;;
26 esac
28 dest="$1"
30 if [ ! -d "$dest" ]; then
31 echo "Destination directory \`$dest' must exist!"
32 exit 1
35 if [ ! -f run_make_tests ]; then
36 echo "The current directory doesn't appear to contain the test suite!"
37 exit 1
40 suite=`pwd | sed 's%^/tmp_mnt%%'`
41 name=`basename "$suite"`
43 files=`echo *`
45 set -e
47 mkdir "$dest/$name"
48 cd "$dest/$name"
50 ln -s "$suite" .testdir
52 for f in $files; do
53 ln -s .testdir/$f .
54 done
56 rm -rf work
58 echo "Shadow test suite created in \`$dest/$name'."
59 exit 0