home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-387-Vol-3of3.iso
/
m
/
mawk11as.zip
/
BUILD_MA.WK
< prev
next >
Wrap
Text File
|
1991-12-18
|
3KB
|
148 lines
#!/bin/sh
#
# build_mawk -- build mawk for a known configuration
#
# usage: build_mawk configuration [CC=your_cc]
# build_mawk MF
#
# example: build_mawk sun_os40 CC=gcc
#
# build_mawk MF -- to get a generic Makefile
#
progname=`basename $0`
if [ $# = 0 ]
then
echo usage: $progname configuration [CC=your_cc] 1>&2
echo " $progname MF" 1>&2
echo 1>&2
echo tested configurations are listed in UCONFIG 1>&2
echo MF builds a fresh Makefile 1>&2
exit 1
fi
config=$1
shift
[ $# != 0 ] && eval "$@"
[ "$CC" = "" ] && CC=cc
case $config in
sun_os40)
if sun3 && [ $CC = cc ]
then cflags='-O -f68881'
fi
config=sun_os40.h ;;
sun3_os40_no68881)
config=sun_os40.h ;;
sun_os41)
if sun3 && [ $CC = cc ]
then cflags='-O -f68881'
fi
config=sun_os41.h ;;
sun3_os41_no68881)
config=sun_os41.h ;;
bsd43_vax)
config=bsd43_vax.h ;;
ultrix41_mips)
config=generic.h ;;
ultrix42_mips)
config=ultrix42_mips.h
cflags='-O -Olimit 700' ;;
ultrix41_vax)
config=ultrix_vax.h
cflags='-O -YSYSTEM_FIVE' ;;
ultrix31_vax)
config=ultrix_vax.h
cflags='-O -YSYSTEM_FIVE -DHAVE_VOID_PTR=0' ;;
stardentVr3)
config=generic.h ;;
xenix_r2)
config=xenix_r2.h ;;
sysV)
config=sysV.h ;;
sysV_ieeefp)
config=sysV_ieeefp.h ;;
# SCO UNIX has ranlib, but doesn't use it for native UNIX libraries
sysVsco)
config=sysV.h
ranlib=: ;;
apolloSR10.3)
config=apollo.h ;;
dynix)
config=dynix.h ;;
atarist)
config=atarist.h
ranlib=:
ar=car
mathlib=-lpml
CC=cgcc ;;
mips)
config=mips.h
cflags='-O -systype bsd43' ;;
MF) ;;
*) echo "$progname: $1: unrecognized configuration" 1>&2
exit 1 ;;
esac
[ "$cflags" = "" ] && cflags=-O
[ "$ranlib" = "" ] && ranlib=ranlib
[ "$ar" = "" ] && ar=ar
[ "$mathlib" = "" ] && mathlib=-lm
echo generating a Makefile
(
echo "# This Makefile was generated by"
echo '#'" $0 $config $*"
sed -e 1,5d \
-e "s/%CC%/$CC/" \
-e "s/%CFLAGS%/$cflags/" \
-e "s/%RANLIB%/$ranlib/" \
-e "s/%AR%/$ar/" \
-e "s/%MATHLIB%/$mathlib/" Makefile.in
) > Makefile
[ $config = MF ] && exit 0
rm -f config.h
echo linking config/$config to config.h
ln config/$config config.h
# make sure parse.c is not made if it exists
# it should exist
[ -f parse.c ] && { echo touching parse.c ; touch parse.c ; }
echo make -f Makefile
make -f Makefile