3 # $Id: makeSH,v 3.0.1.1 1993/08/19 06:42:16 ram Exp ram $
5 # Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
7 # You may redistribute only under the terms of the Artistic Licence,
8 # as specified in the README file that comes with the distribution.
9 # You may reuse parts of this distribution only within the terms of
10 # that same Artistic Licence; a copy of which may be found at the root
11 # of the source tree for dist 4.0.
13 # Original Author: Larry Wall <lwall@netlabs.com>
16 # Revision 3.0.1.1 1993/08/19 06:42:16 ram
17 # patch1: leading config.sh searching was not aborting properly
19 # Revision 3.0 1993/08/18 12:04:26 ram
20 # Baseline for dist 3.0 netwide release.
24 if test -f $file.SH; then
25 mv $file.SH $file.SH.old
26 echo "makeSH: renaming $file.SH as $file.SH.old."
30 cat >$file.SH <<BLURFL
33 if test -f config.sh; then TOP=.;
34 elif test -f ../config.sh; then TOP=..;
35 elif test -f ../../config.sh; then TOP=../..;
36 elif test -f ../../../config.sh; then TOP=../../..;
37 elif test -f ../../../../config.sh; then TOP=../../../..;
39 echo "Can't find config.sh."; exit 1
44 : This forces SH files to create target in same directory as SH file.
45 : This is so that make depend always knows where to find SH derivatives.
47 */*) cd \`expr X\$0 : 'X\(.*\)/'\` ;;
49 echo "Extracting $file (with variable substitutions)"
50 : This section of the file will have variable substitutions done on it.
51 : Move anything that needs config subs from !NO!SUBS! section to !GROK!THIS!.
52 : Protect any dollar signs and backticks that you do not want interpreted
53 : by putting a backslash in front. You may delete these comments.
54 \$spitshell >$base <<!GROK!THIS!
58 */bin/sh) echo '$startsh' >>$file.SH ;;
61 cat >>$file.SH <<BLURFL
64 : In the following dollars and backticks do not need the extra backslash.
65 \$spitshell >>$base <<'!NO!SUBS!'
68 sed -e '1{' -e '/#!.*\/bin\/sh$/d' -e '}' $file >>$file.SH
70 cat >>$file.SH <<BLURFL