xref: /netbsd-src/external/gpl2/gmake/dist/tests/mkshadow (revision 69606e3f5c9388e52aed8c120ad63c049ca45d8f)
1*69606e3fSchristos#!/bin/sh
2*69606e3fSchristos#
3*69606e3fSchristos# Simple script to make a "shadow" test directory, using symbolic links.
4*69606e3fSchristos# Typically you'd put the shadow in /tmp or another local disk
5*69606e3fSchristos#
6*69606e3fSchristos# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
7*69606e3fSchristos# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
8*69606e3fSchristos# This file is part of GNU Make.
9*69606e3fSchristos#
10*69606e3fSchristos# GNU Make is free software; you can redistribute it and/or modify it under the
11*69606e3fSchristos# terms of the GNU General Public License as published by the Free Software
12*69606e3fSchristos# Foundation; either version 2, or (at your option) any later version.
13*69606e3fSchristos#
14*69606e3fSchristos# GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
15*69606e3fSchristos# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16*69606e3fSchristos# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
17*69606e3fSchristos#
18*69606e3fSchristos# You should have received a copy of the GNU General Public License along with
19*69606e3fSchristos# GNU Make; see the file COPYING.  If not, write to the Free Software
20*69606e3fSchristos# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
21*69606e3fSchristos
22*69606e3fSchristoscase "$1" in
23*69606e3fSchristos  "") echo 'Usage: mkshadow <destdir>'; exit 1 ;;
24*69606e3fSchristosesac
25*69606e3fSchristos
26*69606e3fSchristosdest="$1"
27*69606e3fSchristos
28*69606e3fSchristosif [ ! -d "$dest" ]; then
29*69606e3fSchristos  echo "Destination directory \`$dest' must exist!"
30*69606e3fSchristos  exit 1
31*69606e3fSchristosfi
32*69606e3fSchristos
33*69606e3fSchristosif [ ! -f run_make_tests ]; then
34*69606e3fSchristos  echo "The current directory doesn't appear to contain the test suite!"
35*69606e3fSchristos  exit 1
36*69606e3fSchristosfi
37*69606e3fSchristos
38*69606e3fSchristossuite=`pwd | sed 's%^/tmp_mnt%%'`
39*69606e3fSchristosname=`basename "$suite"`
40*69606e3fSchristos
41*69606e3fSchristosfiles=`echo *`
42*69606e3fSchristos
43*69606e3fSchristosset -e
44*69606e3fSchristos
45*69606e3fSchristosmkdir "$dest/$name"
46*69606e3fSchristoscd "$dest/$name"
47*69606e3fSchristos
48*69606e3fSchristosln -s "$suite" .testdir
49*69606e3fSchristos
50*69606e3fSchristosfor f in $files; do
51*69606e3fSchristos  ln -s .testdir/$f .
52*69606e3fSchristosdone
53*69606e3fSchristos
54*69606e3fSchristosrm -rf work
55*69606e3fSchristos
56*69606e3fSchristosecho "Shadow test suite created in \`$dest/$name'."
57*69606e3fSchristosexit 0
58