Anonymous committed 5c5917d

Nettoyage du bootstrap.


Comments (0)

Files changed (1)

   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
   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
 	cd byterun; $(MAKE) all
 	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
+# Save the current bootstrap compiler
 	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)
 	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
 	mv boot/Saved/* boot
         else echo "Fixpoint not reached, try one more bootstrapping cycle."; \
-# Complete bootstrapping cycle
-bootstrap: promote clean all compare
 # Remove old bootstrap compilers
 	rm -rf boot/Saved/Saved.prev/*
 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
 	cd stdlib; $(MAKE) all
+	cd stdlib; $(MAKE) RUNTIME=../byterun/camlrun all
 	cd stdlib; $(MAKE) clean
 # The lexer and parser generators
 	cd lex; $(MAKE)
 	cd lex; $(MAKE) clean
 	cd lex; $(MAKE) depend
 	cd yacc; $(MAKE)
 	cd yacc; $(MAKE) clean
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.