1 #! /bin/sh
2 #
3 # Copyright (c) 1999, 2000 Sascha Schumann. All rights reserved.
4 #
5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions
7 # are met:
8 # 1. Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer.
10 # 2. Redistributions in binary form must reproduce the above copyright
11 # notice, this list of conditions and the following disclaimer in the
12 # documentation and/or other materials provided with the distribution.
13 #
14 # THIS SOFTWARE IS PROVIDED BY SASCHA SCHUMANN ``AS IS'' AND ANY EXPRESS OR
15 # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
16 # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
17 # EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
18 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
19 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
20 # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
21 # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
22 # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
23 # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 #
25 ##############################################################################
26 # $Id$
27 #
29 srcdir=$1
30 shift
32 mkdir_p=$1
33 shift
35 top_srcdir=`(cd $srcdir; pwd)`
36 top_builddir=`pwd`
38 if test "$mkdir_p" = "yes"; then
39 mkdir_p="mkdir -p"
40 else
41 mkdir_p="$top_srcdir/helpers/mkdir.sh"
42 fi
44 for makefile in $@; do
45 echo "creating $makefile"
46 dir=`echo $makefile|sed 's%/*[^/][^/]*$%%'`
47 $mkdir_p "$dir/"
49 cat - $top_srcdir/$makefile.in <<EOF >$makefile
50 top_srcdir = $top_srcdir
51 top_builddir = $top_builddir
52 srcdir = $top_srcdir/$dir
53 builddir = $top_builddir/$dir
54 VPATH = $top_srcdir/$dir
55 EOF
57 test -z "$dir" || touch $dir/.deps
58 done