Nettoyage du bootstrap.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@39 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
master
Xavier Leroy 1995-06-18 14:43:13 +00:00
parent 30ef39841f
commit 170fb62ccd
1 changed files with 38 additions and 13 deletions

View File

@ -29,8 +29,9 @@ TYPING=typing/ident.cmo typing/path.cmo typing/typedtree.cmo \
typing/typedecl.cmo typing/typemod.cmo
BYTECOMP=bytecomp/lambda.cmo bytecomp/printlambda.cmo \
bytecomp/matching.cmo bytecomp/translcore.cmo bytecomp/translmod.cmo \
bytecomp/instruct.cmo bytecomp/dectree.cmo bytecomp/codegen.cmo \
bytecomp/dectree.cmo bytecomp/matching.cmo \
bytecomp/translcore.cmo bytecomp/translmod.cmo \
bytecomp/instruct.cmo bytecomp/codegen.cmo \
bytecomp/printinstr.cmo bytecomp/opcodes.cmo bytecomp/emitcode.cmo \
bytecomp/runtimedef.cmo bytecomp/symtable.cmo \
bytecomp/librarian.cmo bytecomp/linker.cmo
@ -55,11 +56,27 @@ PERVASIVES=arg array char filename format hashtbl lexing list map \
obj parsing pervasives printexc printf queue set sort stack string sys
# Recompile the system using the bootstrap compiler
all: runtime camlc camltop lex/camllex yacc/camlyacc library
all: runtime camlc camllex camlyacc library camltop
# The compilation of camltop will fail if the runtime has changed.
# Never mind, just do make bootstrap to reach fixpoint again.
# Compile everything the first time
world: coldstart all
# Complete bootstrapping cycle
bootstrap: backup promote-cross clean camlc camllex library-cross \
promote clean all compare
# backup save the bootstrap compiler
# promote-cross promote the new compiler but keep the old runtime
# (runs on boot/camlrun, produces code for byterun/camlrun)
# clean camlc camllex
# rebuild the compiler (runs on byterun/camlrun)
# library-cross rebuild the library (using byterun/camlrun camlc)
# promote promote the new compiler and the new runtime
# clean all rebuild everything
# compare check fixpoint
# Start up the system from the distribution compiler
coldstart:
cd byterun; $(MAKE) all
@ -69,20 +86,29 @@ coldstart:
cd stdlib; $(MAKE) COMPILER=../boot/camlc all
cp stdlib/stdlib.cma stdlib/*.cmi stdlib/cslheader boot
# Promote the newly compiled system to the rank of bootstrap compiler
promote:
# Save the current bootstrap compiler
backup:
test -d boot/Saved || mkdir boot/Saved
mv boot/Saved boot/Saved.prev
mkdir boot/Saved
mv boot/Saved.prev boot/Saved/Saved.prev
mv boot/camlrun boot/camlc boot/camllex boot/camlyacc boot/Saved
cp boot/camlrun boot/Saved
mv boot/camlc boot/camllex boot/camlyacc boot/Saved
mv boot/*.cmi boot/stdlib.cma boot/cslheader boot/Saved
cp byterun/camlrun boot/camlrun
# Promote the newly compiled system to the rank of cross compiler
# (Runs on the old runtime, produces code for the new runtime)
promote-cross:
cp camlc boot/camlc
cp lex/camllex boot/camllex
cp yacc/camlyacc boot/camlyacc
cp stdlib/stdlib.cma stdlib/*.cmi stdlib/cslheader boot
# Promote the newly compiled system to the rank of bootstrap compiler
# (Runs on the new runtime, produces code for the new runtime)
promote: promote-cross
cp byterun/camlrun boot/camlrun
# Restore the saved bootstrap compiler if a problem arises
restore:
mv boot/Saved/* boot
@ -96,9 +122,6 @@ compare:
else echo "Fixpoint not reached, try one more bootstrapping cycle."; \
fi
# Complete bootstrapping cycle
bootstrap: promote clean all compare
# Remove old bootstrap compilers
cleanboot:
rm -rf boot/Saved/Saved.prev/*
@ -132,7 +155,7 @@ clean::
camltop: $(TOPOBJS) expunge
$(CAMLC) $(LINKFLAGS) -linkall -o camltop.tmp $(TOPOBJS)
$(CAMLRUN) ./expunge camltop.tmp camltop $(PERVASIVES)
- $(CAMLRUN) ./expunge camltop.tmp camltop $(PERVASIVES)
rm -f camltop.tmp
clean::
@ -220,6 +243,8 @@ alldepend::
library:
cd stdlib; $(MAKE) all
library-cross:
cd stdlib; $(MAKE) RUNTIME=../byterun/camlrun all
clean::
cd stdlib; $(MAKE) clean
alldepend::
@ -227,14 +252,14 @@ alldepend::
# The lexer and parser generators
lex/camllex:
camllex:
cd lex; $(MAKE)
clean::
cd lex; $(MAKE) clean
alldepend::
cd lex; $(MAKE) depend
yacc/camlyacc:
camlyacc:
cd yacc; $(MAKE)
realclean::
cd yacc; $(MAKE) clean