1987-02-10 09:27:44 +00:00
|
|
|
: create a directory Xsrc with name clashes resolved
|
|
|
|
: and run make in that directory
|
|
|
|
: '$Header$'
|
|
|
|
|
|
|
|
case $# in
|
|
|
|
1)
|
|
|
|
;;
|
|
|
|
*) echo "$0: one argument expected" 1>&2
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
PW=`pwd`
|
1988-02-16 16:23:00 +00:00
|
|
|
options=
|
1987-02-10 09:27:44 +00:00
|
|
|
case $1 in
|
1988-09-20 16:44:27 +00:00
|
|
|
main|emain|lnt)
|
1987-02-10 09:27:44 +00:00
|
|
|
target=$PW/$1
|
|
|
|
;;
|
1988-02-16 16:23:00 +00:00
|
|
|
omain)
|
|
|
|
target=$PW/$1
|
|
|
|
options=-DPEEPHOLE
|
|
|
|
;;
|
1988-06-10 09:17:45 +00:00
|
|
|
cemain)
|
|
|
|
target=$PW/$1
|
|
|
|
options=-DCODE_EXPANDER
|
|
|
|
;;
|
1987-02-10 09:27:44 +00:00
|
|
|
Xlint)
|
|
|
|
target=$1
|
|
|
|
;;
|
|
|
|
*) echo "$0: $1: Illegal argument" 1>&2
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
if test -d ../Xsrc
|
|
|
|
then
|
|
|
|
:
|
|
|
|
else mkdir ../Xsrc
|
|
|
|
fi
|
1987-06-30 18:30:45 +00:00
|
|
|
make EMHOME=$EMHOME longnames
|
1987-02-10 09:27:44 +00:00
|
|
|
: remove code generating routines from the clashes list as they are defines.
|
|
|
|
: code generating routine names start with C_
|
|
|
|
sed '/^C_/d' < longnames > tmp$$
|
|
|
|
cclash -c -l7 tmp$$ > ../Xsrc/Xclashes
|
|
|
|
rm -f tmp$$
|
|
|
|
cd ../Xsrc
|
|
|
|
if cmp -s Xclashes clashes
|
|
|
|
then
|
|
|
|
:
|
|
|
|
else
|
|
|
|
mv Xclashes clashes
|
|
|
|
fi
|
1988-08-08 18:03:12 +00:00
|
|
|
rm -f Makefile
|
1987-02-10 09:27:44 +00:00
|
|
|
for i in `cat $PW/Cfiles`
|
|
|
|
do
|
1988-08-08 18:03:12 +00:00
|
|
|
cat >> Makefile <<EOF
|
1987-02-10 09:27:44 +00:00
|
|
|
|
|
|
|
$i: clashes $PW/$i
|
|
|
|
cid -Fclashes < $PW/$i > $i
|
|
|
|
EOF
|
|
|
|
done
|
1987-06-30 18:30:45 +00:00
|
|
|
make EMHOME=$EMHOME `cat $PW/Cfiles`
|
1988-08-08 18:03:12 +00:00
|
|
|
rm -f Makefile
|
|
|
|
ed - $PW/Makefile <<'EOF'
|
1987-03-18 09:35:31 +00:00
|
|
|
/^#EXCLEXCL/,/^#INCLINCL/d
|
1988-08-08 18:03:12 +00:00
|
|
|
w Makefile
|
1987-03-18 09:35:31 +00:00
|
|
|
q
|
|
|
|
EOF
|
1989-10-13 09:25:21 +00:00
|
|
|
make EMHOME=$EMHOME COPTIONS=$options MACH=$mach CURRDIR=$PW/ $target
|