home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-04-05 | 2.0 KB | 110 lines | [TEXT/????] |
- #! /bin/sh
- # mkmf - friendly interface to makemakefile
-
- PROGNAME=`basename $0`
- USAGE="usage: $PROGNAME [-a arch] [-o os] [-t topdir] [-p port] [application];
- if no application specified, a port makefile is created,
- else an application makefile is created."
-
- TOP=`(cd ..; pwd)`
- case $TOP in
- /tmp_mnt/meermin/meermin/ufs1/amoeba/*) TOP=`
- echo "$TOP" | sed 's,^/tmp_mnt/meermin/meermin/ufs1/amoeba/,/ufs/,'
- `
- ;;
- /tmp_mnt/meermin/meermin/*) TOP=`
- echo "$TOP" | sed 's,^/tmp_mnt/meermin/,/hosts/,'
- `
- ;;
- esac
-
- PORT=x11
-
- if ARCH=`(arch) 2>/dev/null`
- then
- case $ARCH in
- sun[34]) OS=sunos;;
- sgi) OS=sysv;;
- dec_risc) OS=ultrix;;
- esac
- elif ARCH=`(machine) 2>/dev/null`
- then
- case $ARCH in
- vax) OS=ultrix;;
- tahoe) OS=bsd;;
- esac
- elif (hp-pa) 2>/dev/null
- then
- ARCH=hppa
- OS=hpux
- elif (mips) 2>/dev/null
- then
- ARCH=mips
- OS=riscos
- fi
-
- while :
- do
- case $1 in
- -a) ARCH=$2; shift; shift;;
- -o) OS=$2; shift; shift;;
- -p) PORT=$2; shift; shift;;
- -t) TOP=$2; shift; shift;;
- -*) echo "$USAGE" 1>&2; exit 2;;
- *) break;;
- esac
- done
-
- case $OS in
- '') echo "Sorry, can't guess operating system, use -o"; exit 2;;
- esac
-
- case $ARCH in
- '') echo "Sorry, can't guess architecture, use -a" 1>&2; exit 2;;
- esac
-
- # Check out how to suppress trailing newline with echo
-
- case `echo -n` in
- -n) n=; c='\c';;
- '') n=-n; c=;;
- esac
-
- # Create top level in the Build tree if necessary
-
- if test ! -d $TOP/Build
- then
- echo $n "Create $TOP/Build? [ny] $c"
- read reply
- case $reply in
- [yY]*) mkdir $TOP/Build || exit;;
- *) exit;;
- esac
- fi
-
- if test ! -d $TOP/Build/$ARCH
- then
- echo $n "Create $TOP/Build/$ARCH? [ny] $c"
- read reply
- case $reply in
- [yY]*) mkdir $TOP/Build/$ARCH || exit;;
- *) exit;;
- esac
- fi
-
- if test ! -d $TOP/Build/$ARCH/$PORT
- then
- echo $n "Create $TOP/Build/$ARCH/$PORT? [ny] $c"
- read reply
- case $reply in
- [yY]*) mkdir $TOP/Build/$ARCH/$PORT || exit;;
- *) exit;;
- esac
- fi
-
- case $# in
- 0) set -x; makemakefile $TOP $OS $ARCH $PORT Ports/$PORT lib;;
- 1) set -x; makemakefile $TOP $OS $ARCH $PORT Appls/$1 $1;;
- *) echo "$USAGE" 1>&2; exit 2;;
- esac
-