2 # @(#) Generates a Makefile from a Jmakefile
4 # $Id: jmkmf.SH 1 2006-08-24 12:32:52Z rmanfredi $
6 # Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
8 # You may redistribute only under the terms of the Artistic Licence,
9 # as specified in the README file that comes with the distribution.
10 # You may reuse parts of this distribution only within the terms of
11 # that same Artistic Licence; a copy of which may be found at the root
12 # of the source tree for dist 4.0.
15 # Revision 3.0.1.2 2004/08/21 23:18:13 ram
16 # patch71: automatically figures the top dir and the current dir
17 # patch71: don't run Makefile.SH if the jmake call failed
19 # Revision 3.0.1.1 1993/08/19 06:42:14 ram
20 # patch1: leading config.sh searching was not aborting properly
22 # Revision 3.0 1993/08/18 12:04:19 ram
23 # Baseline for dist 3.0 netwide release.
26 usage="usage: $0 [top_of_sources_pathname [current_directory]]"
32 if test -f .package; then topdir=.;
33 elif test -f ../.package; then topdir=..;
34 elif test -f ../../.package; then topdir=../..;
35 elif test -f ../../../.package; then topdir=../../..;
36 elif test -f ../../../../.package; then topdir=../../../..;
38 echo "$0: WARNING: can't determine top package directory" >&2
42 2) topdir=$1 curdir=$2 ;;
43 *) echo "$usage" 1>&2; exit 1 ;;
47 -*) echo "$usage" 1>&2; exit 1 ;;
55 'print substr($ARGV[0], length($ARGV[1])+1), "\n";' $here $top`
62 if test -f Jmakefile; then
65 echo "$0: no Jmakefile found in current directory" >&2
69 if test -f Makefile.SH; then
70 echo mv Makefile.SH Makefile.SH~
71 mv Makefile.SH Makefile.SH~
74 args="-DTOPDIR=$topdir -DCURDIR=$curdir"
81 echo "jmake failed, aborting" >&2