Moved the bootstrap check into a separate shell script.

This commit is contained in:
Zoltan Somogyi
1995-04-30 11:58:22 +00:00
parent 57e3bc01db
commit 0c4c5adf01
2 changed files with 145 additions and 67 deletions

75
Mmake
View File

@@ -35,13 +35,18 @@ library/library.dep:
cd library && $(SUBDIR_MMAKE) depend
.PHONY: dep_compiler
dep_compiler: compiler/mercury_compile.dep
dep_compiler: compiler/mercury_compile.dep
compiler/mercury_compile.dep:
compiler/mercury_compile.dep: library/library.dep
cd compiler && $(SUBDIR_MMAKE) depend
# the two mmake depends must be done in this order
# this is why depend_{library,compiler} should not be sources for depend
.PHONY: depend
depend: depend_library depend_compiler
depend:
cd library && $(SUBDIR_MMAKE) depend
cd compiler && $(SUBDIR_MMAKE) depend
.PHONY: depend_library
depend_library:
@@ -96,70 +101,6 @@ tar:
#-----------------------------------------------------------------------------#
.PHONY: bootstrap_check
bootstrap_check: stage_1 stage_2 stage_3
diff stage2 stage3
.PHONY: stage_1
stage_1: all
[ -d stage1 ] || mkdir stage1
mv compiler/mercury_compile stage1
mv compiler/*.mod library/*.mod stage1
mv compiler/*.c library/*.c stage1
mv compiler/*.o library/*.o stage1
cd compiler && rm -f *.mod *.c *.o *.pic_o mercury_compile
cd library && rm -f *.mod *.c *.o *.pic_o *.a *.so
.PHONY: stage_2
stage_2:
cd library && \
MERCURY_COMPILER="`pwd`/../stage1/mercury_compile" \
$(SUBDIR_MMAKE)
cd compiler && \
MERCURY_COMPILER="`pwd`/../stage1/mercury_compile" \
$(SUBDIR_MMAKE)
[ -d stage2 ] || mkdir stage2
mv compiler/mercury_compile stage2
mv compiler/*.mod library/*.mod stage2
mv compiler/*.c library/*.c stage2
mv compiler/*.o library/*.o stage2
cd compiler && rm -f *.mod *.c *.o *.pic_o mercury_compile
cd library && rm -f *.mod *.c *.o *.pic_o *.a *.so
.PHONY: stage_3
stage_3:
cd library && \
MERCURY_COMPILER="`pwd`/../stage2/mercury_compile" \
$(SUBDIR_MMAKE)
cd compiler && \
MERCURY_COMPILER="`pwd`/../stage2/mercury_compile" \
$(SUBDIR_MMAKE)
[ -d stage3 ] || mkdir stage3
mv compiler/mercury_compile stage3
mv compiler/*.mod library/*.mod stage3
mv compiler/*.c library/*.c stage3
mv compiler/*.o library/*.o stage3
cd compiler && rm -f *.mod *.c *.o *.pic_o mercury_compile
cd library && rm -f *.mod *.c *.o *.pic_o *.a *.so
.PHONY: stage_4
stage_4:
cd library && \
MERCURY_COMPILER="`pwd`/../stage3/mercury_compile" \
$(SUBDIR_MMAKE)
cd compiler && \
MERCURY_COMPILER="`pwd`/../stage3/mercury_compile" \
$(SUBDIR_MMAKE)
[ -d stage4 ] || mkdir stage4
mv compiler/mercury_compile stage4
mv compiler/*.mod library/*.mod stage4
mv compiler/*.c library/*.c stage4
mv compiler/*.o library/*.o stage4
cd compiler && rm -f *.mod *.c *.o *.pic_o mercury_compile
cd library && rm -f *.mod *.c *.o *.pic_o *.a *.so
#-----------------------------------------------------------------------------#
.PHONY: install
install: all install_scripts install_runtime install_boehm_gc \
install_library install_compiler install_doc \

137
bcheck Executable file
View File

@@ -0,0 +1,137 @@
#!/bin/sh
set -x
usage="bcheck [-jN] [-o filename]"
jfactor=""
outfile=""
while getopts j:o: flag
do
case $flag in
j) jfactor="-j$OPTARG" ;;
o) outfile=$OPTARG ;;
\\?) echo $usage;
exit 1 ;;
esac
done
shift `expr "$OPTIND" - 1`
if [ $# -ne 0 ]
then
echo $usage
exit 1
fi
if mmake $jfactor all
then
echo "building of stage 1 successful"
else
echo "building of stage 1 not successful"
exit 1
fi
root=`/bin/pwd`
# .pp files are not necessary
[ -d stage2 ] || mkdir stage2
/bin/rm -fr stage2/*
mkdir stage2/compiler
mkdir stage2/library
cp compiler/*.m stage2/compiler
cp compiler/Mmake* stage2/compiler
cp library/*.m stage2/library
cp library/Mmake* stage2/library
ln -s $root/boehm_gc stage2/boehm_gc
ln -s $root/doc stage2/doc
ln -s $root/runtime stage2/runtime
ln -s $root/scripts stage2/scripts
cp Mmake* stage2
MERCURY_COMPILER=$root/compiler/mercury_compile
export MERCURY_COMPILER
MERCURY_INT_DIR=$root/stage2/library
export MERCURY_INT_DIR
if (cd stage2 ; mmake depend)
then
echo "building of stage 2 dependencies successful"
else
echo "building of stage 2 dependencies not successful"
exit 1
fi
if (cd stage2 ; mmake $jfactor library)
then
echo "building of stage 2 library successful"
else
echo "building of stage 2 library not successful"
exit 1
fi
if (cd stage2 ; mmake $jfactor all)
then
echo "building of stage 2 successful"
else
echo "building of stage 2 not successful"
exit 1
fi
# .pp files are not necessary
[ -d stage3 ] || mkdir stage3
/bin/rm -fr stage3/*
mkdir stage3/compiler
mkdir stage3/library
cp compiler/*.m stage3/compiler
cp compiler/Mmake* stage3/compiler
cp library/*.m stage3/library
cp library/Mmake* stage3/library
ln -s $root/boehm_gc stage3/boehm_gc
ln -s $root/doc stage3/doc
ln -s $root/runtime stage3/runtime
ln -s $root/scripts stage3/scripts
cp Mmake* stage3
MERCURY_COMPILER=$root/stage2/compiler/mercury_compile
export MERCURY_COMPILER
MERCURY_INT_DIR=$root/stage3/library
export MERCURY_INT_DIR
if (cd stage3 ; mmake depend)
then
echo "building of stage 3 dependencies successful"
else
echo "building of stage 3 dependencies not successful"
exit 1
fi
if (cd stage3 ; mmake $jfactor library)
then
echo "building of stage 3 library successful"
else
echo "building of stage 3 library not successful"
exit 1
fi
if (cd stage3 ; mmake $jfactor all)
then
echo "building of stage 3 successful"
else
echo "building of stage 3 not successful"
exit 1
fi
if [ -n "$outfile" ]
then
diff stage2/library stage3/library > "$outfile"
diff stage2/compiler stage3/compiler >> "$outfile"
else
diff stage2/library stage3/library
diff stage2/compiler stage3/compiler
fi
exit 0