Root Makefile enhancements

This commit contains the following fixes and enhancements to the
root Makefile:

 * coreall: add dependency on runtime
 * all: before this commit, this target was depending on runtime and started
   by making coreall. This commit simplifies this and just makes this target
   depend on coreall, which is both simpler and semantically more accurate.
 * compare: let this target exit if the comparison fails
 * bootstrap: this commit removes the final invocation to make compare.
   The comparison was actually done twice, (1) as the final step of coreboot
   and (2) as the final step of bootstrap. The motivation for that was to
   ensure that the comparison messages were not lost and did appear last.
   Actually, it turns out that if the comparison fails, it makes no
   sense to continue the bootstrap process. That's why compare now exits
   immediately when it fails and there is thus no need to perform it twice.
 * Get rid of backup and restore targets which have become obsolete
   with the use of a revision control system
master
Sébastien Hinderer 2018-05-29 16:21:46 +02:00
parent b2240b9878
commit 4a2fa2978f
1 changed files with 5 additions and 24 deletions

View File

@ -398,7 +398,7 @@ coldstart:
# Recompile the core system using the bootstrap compiler
.PHONY: coreall
coreall:
coreall: runtime
$(MAKE) ocamlc
$(MAKE) ocamllex ocamlyacc ocamltools library
@ -408,30 +408,15 @@ core:
$(MAKE) coldstart
$(MAKE) coreall
# Save the current bootstrap compiler
.PHONY: backup
backup:
$(MKDIR) boot/Saved
if test -d $(MAXSAVED); then rm -r $(MAXSAVED); fi
mv boot/Saved boot/Saved.prev
mkdir boot/Saved
mv boot/Saved.prev boot/Saved/Saved.prev
cp boot/ocamlrun$(EXE) boot/Saved
cd boot; mv ocamlc ocamllex ocamlyacc$(EXE) Saved
cd boot; cp $(LIBFILES) Saved
# Restore the saved bootstrap compiler if a problem arises
.PHONY: restore
restore:
cd boot; mv Saved/* .; rmdir Saved; mv Saved.prev Saved
# Check if fixpoint reached
.PHONY: compare
compare:
@if $(CAMLRUN) tools/cmpbyt boot/ocamlc ocamlc \
&& $(CAMLRUN) tools/cmpbyt boot/ocamllex lex/ocamllex; \
then echo "Fixpoint reached, bootstrap succeeded."; \
else echo "Fixpoint not reached, try one more bootstrapping cycle."; \
else \
echo "Fixpoint not reached, try one more bootstrapping cycle."; \
exit 1; \
fi
# Promote a compiler
@ -493,8 +478,6 @@ opt.opt:
# Core bootstrapping cycle
.PHONY: coreboot
coreboot:
# Save the original bootstrap compiler
$(MAKE) backup
# Promote the new compiler but keep the old runtime
# This compiler runs on boot/ocamlrun and produces bytecode for
# byterun/ocamlrun
@ -515,8 +498,7 @@ coreboot:
# Recompile the system using the bootstrap compiler
.PHONY: all
all: runtime
$(MAKE) coreall
all: coreall
$(MAKE) ocaml
$(MAKE) otherlibraries $(WITH_DEBUGGER) $(WITH_OCAMLDOC) ocamltest
@ -526,7 +508,6 @@ all: runtime
.PHONY: bootstrap
bootstrap: coreboot
$(MAKE) all
$(MAKE) compare
# Compile everything the first time