diff --git a/.gitignore b/.gitignore index ee680cc3f274..eeed783931bc 100644 --- a/.gitignore +++ b/.gitignore @@ -73,7 +73,6 @@ META /asmcomp/CSE.ml /boot/ocamlrun -/boot/ocamlruns /boot/camlheader /boot/ocamlc.opt diff --git a/Makefile b/Makefile index 0255bdd8b544..4c43e89f3cf6 100644 --- a/Makefile +++ b/Makefile @@ -177,16 +177,13 @@ FLEXLINK_BUILD_ENV = \ FLEXDLL_SOURCES = \ $(FLEXDLL_C_SOURCES) $(wildcard $(FLEXDLL_SOURCE_DIR)/*.ml*) -boot/ocamlruns$(EXE): runtime/ocamlruns$(EXE) - cp $< $@ - $(BYTE_BINDIR) $(OPT_BINDIR): $(MKDIR) $@ flexlink.byte$(EXE): $(FLEXDLL_SOURCES) rm -f $(FLEXDLL_SOURCE_DIR)/flexlink.exe $(MAKE) -C $(FLEXDLL_SOURCE_DIR) $(FLEXLINK_BUILD_ENV) \ - OCAMLRUN='$$(ROOTDIR)/boot/ocamlruns$(EXE)' NATDYNLINK=false \ + OCAMLRUN='$$(ROOTDIR)/boot/ocamlrun$(EXE)' NATDYNLINK=false \ OCAMLOPT='$(value BOOT_OCAMLC) $(USE_RUNTIME_PRIMS) $(USE_STDLIB)' \ flexlink.exe support cp $(FLEXDLL_SOURCE_DIR)/flexlink.exe $@ @@ -197,7 +194,7 @@ partialclean:: $(BYTE_BINDIR)/flexlink$(EXE): flexlink.byte$(EXE) | $(BYTE_BINDIR) rm -f $@ # Start with a copy to ensure that the result is always executable - cp boot/ocamlruns$(EXE) $@ + cp boot/ocamlrun$(EXE) $@ cat flexlink.byte$(EXE) >> $@ cp $(addprefix $(FLEXDLL_SOURCE_DIR)/, $(FLEXDLL_OBJECTS)) $(BYTE_BINDIR) @@ -205,26 +202,26 @@ partialclean:: rm -f $(BYTE_BINDIR)/flexlink $(BYTE_BINDIR)/flexlink.exe ifeq "$(BOOTSTRAPPING_FLEXDLL)" "false" - COLDSTART_STDLIB_RUNTIME = runtime/ocamlrun$(EXE) runtime/primitives +boot/ocamlrun$(EXE): runtime/ocamlrun$(EXE) runtime/primitives else - # The recipe for boot/ocamlruns$(EXE) directly produces runtime/primitives - COLDSTART_STDLIB_RUNTIME = boot/ocamlruns$(EXE) +# The recipe for runtime/ocamlruns$(EXE) directly produces runtime/primitives +boot/ocamlrun$(EXE): runtime/ocamlruns$(EXE) $(foreach runtime, ocamlrun ocamlrund ocamlruni, \ $(eval runtime/$(runtime)$(EXE): | $(BYTE_BINDIR)/flexlink$(EXE))) endif +# $< refers to runtime/ocamlruns when bootstrapping flexlink and +# runtime/ocamlrun otherwise (see above). +boot/ocamlrun$(EXE): + cp $< $@ + # Start up the system from the distribution compiler .PHONY: coldstart -coldstart: $(COLDSTART_STDLIB_RUNTIME) +coldstart: boot/ocamlrun$(EXE) runtime/libcamlrun.$(A) $(MAKE) -C stdlib OCAMLRUN='$$(ROOTDIR)/$<' \ CAMLC='$$(BOOT_OCAMLC) $(USE_RUNTIME_PRIMS)' all - $(MAKE) setup-boot - -.PHONY: setup-boot -setup-boot: runtime/ocamlrun$(EXE) - rm -f $(addprefix boot/, ocamlrun$(EXE) libcamlrun.$(A) $(LIBFILES)) - cp $< boot/ocamlrun$(EXE) + rm -f $(addprefix boot/, libcamlrun.$(A) $(LIBFILES)) cp $(addprefix stdlib/, $(LIBFILES)) boot cd boot; $(LN) ../runtime/libcamlrun.$(A) . @@ -1654,7 +1651,6 @@ distclean: clean rm -f utils/config.generated.ml rm -f compilerlibs/META rm -f boot/ocamlrun boot/ocamlrun.exe boot/camlheader \ - boot/ocamlruns boot/ocamlruns.exe \ boot/flexdll_*.o boot/flexdll_*.obj \ boot/*.cm* boot/libcamlrun.a boot/libcamlrun.lib boot/ocamlc.opt rm -f Makefile.config Makefile.build_config diff --git a/ocamldoc/Makefile.best_ocamldoc b/ocamldoc/Makefile.best_ocamldoc index 71b328212294..870102701666 100644 --- a/ocamldoc/Makefile.best_ocamldoc +++ b/ocamldoc/Makefile.best_ocamldoc @@ -18,7 +18,7 @@ OCAMLDOC_OPT = $(ROOTDIR)/ocamldoc/ocamldoc.opt$(EXE) ifeq "$(TARGET)" "$(HOST)" ifeq "$(SUPPORTS_SHARED_LIBRARIES)" "true" - OCAMLDOC_RUN_BYTE = $(OCAMLRUN) -I $(ROOTDIR)/otherlibs/unix \ + OCAMLDOC_RUN_BYTE = $(NEW_OCAMLRUN) -I $(ROOTDIR)/otherlibs/unix \ -I $(ROOTDIR)/otherlibs/str ./$(OCAMLDOC) else # if shared-libraries are not supported, unix.cma and str.cma @@ -27,7 +27,7 @@ ifeq "$(TARGET)" "$(HOST)" OCAMLDOC_RUN_BYTE = ./$(OCAMLDOC) endif else - OCAMLDOC_RUN_BYTE = $(OCAMLRUN) ./$(OCAMLDOC) + OCAMLDOC_RUN_BYTE = $(NEW_OCAMLRUN) ./$(OCAMLDOC) endif OCAMLDOC_RUN_OPT = ./$(OCAMLDOC_OPT)