OLDACM=$ACM
OLDSYS=$SYS
case $SYSNAME in
-vax_bsd4_1a) ACM=vax4 ; SYS=BSD4_1 ; BYTE_ORDER=0123 ;;
-vax_bsd4_2) ACM=vax4 ; SYS=BSD4_2 ; BYTE_ORDER=0123 ;;
-vax_sysV_2) ACM=vax4 ; SYS=SYS_5 ; BYTE_ORDER=0123 ;;
-i386) ACM=i386 ; SYS=SYS_5 ; BYTE_ORDER=0123 ;;
-sun3) ACM=sun3 ; SYS=BSD4_2; BYTE_ORDER=3210 ;;
-sun2) ACM=sun2 ; SYS=BSD4_2; BYTE_ORDER=3210 ;;
-m68_unisoft|m68k2) ACM=m68k2 ; SYS=V7; BYTE_ORDER=3210 ;;
-m68_sysV_0|mantra) ACM=mantra ; SYS=SYS_5; BYTE_ORDER=3210 ;;
-m68020) ACM=m68020 ; SYS=SYS_5; BYTE_ORDER=3210 ;;
-sparc) ACM=sparc ; SYS=BSD4_2; BYTE_ORDER=3210 ;;
-i86) ACM=i86 ; SYS=SYS_5; BYTE_ORDER=0123 ;;
-xenix3) ACM=xenix3 ; SYS=SYS_5; BYTE_ORDER=0123 ;;
-minix) ACM=minix ; SYS=V7; BYTE_ORDER=0123 ;;
-pmds) ACM=pmds ; SYS=V7; BYTE_ORDER=3210 ;;
-pmds4) ACM=pmds4 ; SYS=V7; BYTE_ORDER=3210 ;;
-minixST) ACM=minixST ; SYS=V7; BYTE_ORDER=3210 ;;
-m68k4) ACM=m68k4 ; SYS=V7; BYTE_ORDER=3210 ;;
-*) ACM=XXX ; SYS=XXX ; BYTE_ORDER=XXX ;;
+vax_bsd4_1a) ACM=vax4 ; SYS=BSD4_1 ; BYTE_ORDER=0123 ; MACH=vax4 ;;
+vax_bsd4_2) ACM=vax4 ; SYS=BSD4_2 ; BYTE_ORDER=0123 ; MACH=vax4 ;;
+vax_sysV_2) ACM=vax4 ; SYS=SYS_5 ; BYTE_ORDER=0123 ; MACH=vax4 ;;
+i386) ACM=i386 ; SYS=SYS_5 ; BYTE_ORDER=0123 ; MACH=i386 ;;
+sun3) ACM=sun3 ; SYS=BSD4_2; BYTE_ORDER=3210 ; MACH=m68020 ;;
+sun2) ACM=sun2 ; SYS=BSD4_2; BYTE_ORDER=3210 ; MACH=m68k4 ;;
+m68_unisoft|m68k2) ACM=m68k2 ; SYS=V7; BYTE_ORDER=3210 ; MACH=m68k2 ;;
+m68_sysV_0|mantra) ACM=mantra ; SYS=SYS_5; BYTE_ORDER=3210 ; MACH=m68k4 ;;
+m68020) ACM=m68020 ; SYS=SYS_5; BYTE_ORDER=3210 ; MACH=m68020 ;;
+sparc) ACM=sparc ; SYS=BSD4_2; BYTE_ORDER=3210 ; MACH=sparc ;;
+i86) ACM=i86 ; SYS=SYS_5; BYTE_ORDER=0123 ; MACH=i86 ;;
+xenix3) ACM=xenix3 ; SYS=SYS_5; BYTE_ORDER=0123 ; MACH=i86 ;;
+minix) ACM=minix ; SYS=V7; BYTE_ORDER=0123 ; MACH=i86 ;;
+pmds) ACM=pmds ; SYS=V7; BYTE_ORDER=3210 ; MACH=m68k2 ;;
+pmds4) ACM=pmds4 ; SYS=V7; BYTE_ORDER=3210 ; MACH=m68k4 ;;
+minixST) ACM=minixST ; SYS=V7; BYTE_ORDER=3210 ; MACH=m68k2 ;;
+m68k4) ACM=m68k4 ; SYS=V7; BYTE_ORDER=3210 ; MACH=m68k4 ;;
+*) ACM=XXX ; SYS=XXX ; BYTE_ORDER=XXX ; MACH=XXX ;;
esac
: do not change the order in MACH_LIST. check limit_enquire first.
echo "DO_MACHINE_INDEP=\"$DO_MACHINE_INDEP\"; export DO_MACHINE_INDEP" >> macros
echo "MACH_LIST=\"$MACH_LIST\"; export MACH_LIST" >> macros
echo "SYSVAX=\"$SYSVAX\"; export SYSVAX" >> macros
+echo "MACH=\"$MACH\"; export MACH" >> macros
echo "WS=\"$WS\"; export WS" >> macros
echo "PS=\"$PS\"; export PS" >> macros
# Machine independent part created?
DO_MACHINE_INDEP = $DO_MACHINE_INDEP
+
+# Target machine, only needed for fast compilers
+MACH = $MACH
" > make_macros
if [ $TARGET_HOME = $UTIL_HOME ]
set -e
-PATH=::$SRC_HOME/first:$UTIL_HOME/bin:/bin:/usr/bin:/usr/ucb
+PATH=::$CONFIG/bin:$UTIL_HOME/bin:/bin:/usr/bin:/usr/ucb
export PATH
-mk_config `pwd`/make_macros
+$SRC_HOME/first/create_dir $CONFIG
+$SRC_HOME/first/create_dir $CONFIG/bin
+
+cat macros $SRC_HOME/first/mk_config > $CONFIG/bin/mk_config
+cat macros $SRC_HOME/first/mk_target > $CONFIG/bin/mk_target
+cat macros $SRC_HOME/first/limit_impl > $CONFIG/bin/limit_impl
+
+sed '/^#PARAMS/r make_macros' < $SRC_HOME/first/mk_makefile > $CONFIG/bin/mk_makefile
+chmod +x $CONFIG/bin/*
+cp $SRC_HOME/first/create_dir $CONFIG/bin/create_dir
+
+mk_config
mk_target
case $SYSNAME in
i386)
- ed - $TARGET_HOME/lib/descr/fe << ABC
+ ed - $TARGET_HOME/lib/descr/fe << 'ABC'
1,$s/-D{NAME}/-D{NAME} -DNO_PROTOTYPE/
w
q
then
for i in $CONFIG/mach/*/Action
do
- for j in libem libend libfp libdb libsys libmon libbsd4_2 libbsd4_1a libsysV_2
+ for j in libem libend libfp libdb libsys libmon libbsd4_2 libbsd4_1a libsysV_2 libce
do
if grep -s $j $i
then
set -e
-MACROS=$1
-
-if [ -f $MACROS ]
-then :
-else echo "$0: $MACROS not found" 1>&2
- exit 3
-fi
-
create_dir $CONFIG
cd $SRC_HOME
for i in `cat dir_list`
do
create_dir $i
- rm -f $i/NoAction
+ rm -f $i/No*
+ if [ -f $i/Makefile ]
+ then
+ ( cd $i ; if make clean ; then exit 0 ; else exit 0 ; fi ) > /dev/null 2>&1
+ fi
if [ -f $SRC_HOME/$i/proto.make ]
- then mk_makefile $MACROS $SRC_HOME/$i/proto.make > $i/Makefile
+ then mk_makefile $SRC_HOME/$i/proto.make > $i/Makefile
fi
if [ -f $SRC_HOME/$i/Action ]
then
cd $SRC_HOME/util/ceg/util
for i in make_*
do
- mk_makefile $MACROS $i > $CONFIG/util/ceg/util/$i
+ mk_makefile $i > $CONFIG/util/ceg/util/$i
done
cd $CONFIG
if [ -d $i/as ]
then
cd $i/as
- mk_makefile $MACROS $SRC_HOME/mach/proto/as/proto.make | sed -e "/#MACH_DEFINE/,/^MACH/s/=.*/= $i/" > Makefile
+ mk_makefile $SRC_HOME/mach/proto/as/proto.make | sed -e "/#MACH_DEFINE/,/^MACH/s/=.*/= $i/" > Makefile
cd ../..
fi
if [ -d $i/top ]
then
cd $i/top
- mk_makefile $MACROS $SRC_HOME/mach/proto/top/proto.make | sed -e "/#MACH_DEFINE/,/^MACH/s/=.*/= $i/" > Makefile
+ mk_makefile $SRC_HOME/mach/proto/top/proto.make | sed -e "/#MACH_DEFINE/,/^MACH/s/=.*/= $i/" > Makefile
cd ../..
fi
if [ -d $i/cg ]
then
cd $i/cg
- mk_makefile $MACROS $SRC_HOME/mach/proto/cg/proto.make | sed -e "/#MACH_DEFINE/,/^MACH/s/=.*/= $i/" > Makefile
+ mk_makefile $SRC_HOME/mach/proto/cg/proto.make | sed -e "/#MACH_DEFINE/,/^MACH/s/=.*/= $i/" > Makefile
cd ../..
fi
if [ -d $i/ncg ]
then
cd $i/ncg
- mk_makefile $MACROS $SRC_HOME/mach/proto/ncg/proto.make | sed -e "/#MACH_DEFINE/,/^MACH/s/=.*/= $i/" > Makefile
+ mk_makefile $SRC_HOME/mach/proto/ncg/proto.make | sed -e "/#MACH_DEFINE/,/^MACH/s/=.*/= $i/" > Makefile
if [ -f $SRC_HOME/mach/$i/ncg/table_dir ]
then
ed - Makefile <<EOF
fi
cd ../..
fi
- for j in libem libend libmon libfp libsys libdb
+ for j in libem libend libmon libfp libsys libdb libce
do
if [ -d $i/$j ]
then
cd $i/$j
- mk_makefile $MACROS $SRC_HOME/mach/proto/libg/proto.$j | sed -e "/#MACH_PARAMS/r $SRC_HOME/mach/$i/mach_params" > Makefile
+ mk_makefile $SRC_HOME/mach/proto/libg/proto.$j | sed -e "/#MACH_PARAMS/r $SRC_HOME/mach/$i/mach_params" > Makefile
cd ../..
fi
done
if [ -d $i/$j ]
then
cd $i/$j
- mk_makefile $MACROS $SRC_HOME/mach/proto/libg/proto.libsys | sed -e "/#MACH_PARAMS/r $SRC_HOME/mach/$i/mach_params" -e "s/libsys/$j/g" > Makefile
+ mk_makefile $SRC_HOME/mach/proto/libg/proto.libsys | sed -e "/#MACH_PARAMS/r $SRC_HOME/mach/$i/mach_params" -e "s/libsys/$j/g" > Makefile
cd ../..
fi
done
do
create_dir $i/$j
cd $i/$j
- mk_makefile $MACROS $SRC_HOME/mach/proto/libg/proto.$j | sed -e "/#MACH_PARAMS/r $SRC_HOME/mach/$i/mach_params" > Makefile
+ mk_makefile $SRC_HOME/mach/proto/libg/proto.$j | sed -e "/#MACH_PARAMS/r $SRC_HOME/mach/$i/mach_params" > Makefile
cd ../..
done
if [ $i = vax4 ]
else
create_dir $i/libsys
cd $i/libsys
- mk_makefile $MACROS $SRC_HOME/mach/proto/libg/proto.sysmon | sed -e "/#MACH_PARAMS/r $SRC_HOME/mach/$i/mach_params" > Makefile
+ mk_makefile $SRC_HOME/mach/proto/libg/proto.sysmon | sed -e "/#MACH_PARAMS/r $SRC_HOME/mach/$i/mach_params" > Makefile
cd ../..
fi
fi
: '$Header$'
-: This shell script inserts the file "make_macros" after a line
+: This shell script inserts make macros after a line
: starting with #PARAMS in "make_proto", and produces the result on
: standard output.
+trap "rm -f /tmp/mk_mak$$" 0 1 2 3 15
case $# in
-2) ;;
-*) echo "Usage: $0 <make_macros> <make_proto>" 1>&2
+1) ;;
+*) echo "Usage: $0 <make_proto>" 1>&2
exit 1
;;
esac
-sed -e "/^#PARAMS/r $1" $2
+cp $1 /tmp/mk_mak$$
+
+ed - /tmp/mk_mak$$ << 'EOF'
+/^#PARAMS/c
+#PARAMS do not remove this line!
+.
+w
+q
+EOF
+cat /tmp/mk_mak$$
exit 0
create_dir $TARGET_HOME/h
create_dir $TARGET_HOME/include
create_dir $TARGET_HOME/doc
-create_dir $TARGET_HOME/man
cp $SRC_HOME/etc/ip_spec.t $TARGET_HOME/etc/ip_spec.t
( cd $SRC_HOME/lib ; tar cf - . ) | ( cd $TARGET_HOME/lib ; tar xf - )
( cd $SRC_HOME/include ; tar cf - . ) | ( cd $TARGET_HOME/include ; tar xf - )
( cd $SRC_HOME/h ; tar cf - . ) | ( cd $TARGET_HOME/h ; tar xf - )
-( cd $SRC_HOME/man ; tar cf - . ) | ( cd $TARGET_HOME/man ; tar xf - )
( cd $SRC_HOME/doc ; tar cf - . ) | ( cd $TARGET_HOME/doc ; tar xf - )
cd $TARGET_HOME