Share the rules needed to build the native toplevel.

One side-effect is that ocamlnat is now removed by make clean under
Windows (mingw and msvc), which was not the case before.
master
Sébastien Hinderer 2016-07-31 10:16:06 +02:00 committed by alainfrisch
parent 7b771fa21a
commit e47f29bf85
3 changed files with 20 additions and 32 deletions

View File

@ -379,23 +379,7 @@ natruntop:
$(MAKE) ocamlnat
@rlwrap --help 2>/dev/null && rlwrap $(NATRUNTOP) || $(NATRUNTOP)
# The native toplevel
compilerlibs/ocamlopttoplevel.cmxa: $(OPTTOPLEVEL:.cmo=.cmx)
$(CAMLOPT) -a -o $@ $(OPTTOPLEVEL:.cmo=.cmx)
partialclean::
rm -f compilerlibs/ocamlopttoplevel.cmxa
ocamlnat: compilerlibs/ocamlcommon.cmxa compilerlibs/ocamloptcomp.cmxa \
compilerlibs/ocamlbytecomp.cmxa \
compilerlibs/ocamlopttoplevel.cmxa \
$(OPTTOPLEVELSTART:.cmo=.cmx)
$(CAMLOPT) $(LINKFLAGS) -linkall -o $@ $^
partialclean::
rm -f ocamlnat
toplevel/opttoploop.cmx: otherlibs/dynlink/dynlink.cmxa
# Native dynlink
otherlibs/dynlink/dynlink.cmxa: otherlibs/dynlink/natdynlink.ml
cd otherlibs/dynlink && $(MAKE) allopt

View File

@ -362,25 +362,11 @@ ocaml: compilerlibs/ocamlcommon.cma compilerlibs/ocamlbytecomp.cma \
partialclean::
rm -f ocaml
# The native toplevel
compilerlibs/ocamlopttoplevel.cmxa: $(OPTTOPLEVEL:.cmo=.cmx)
$(CAMLOPT) -a -o $@ $(OPTTOPLEVEL:.cmo=.cmx)
partialclean::
rm -f compilerlibs/ocamlopttoplevel.cmxa
ocamlnat: compilerlibs/ocamlcommon.cmxa compilerlibs/ocamloptcomp.cmxa \
compilerlibs/ocamlbytecomp.cmxa \
compilerlibs/ocamlopttoplevel.cmxa \
$(OPTTOPLEVELSTART:.cmo=.cmx)
$(CAMLOPT) $(LINKFLAGS) -linkall -o $@ $^
toplevel/opttoploop.cmx: otherlibs/dynlink/dynlink.cmxa
# Native dynlink
otherlibs/dynlink/dynlink.cmxa: otherlibs/dynlink/natdynlink.ml
cd otherlibs/dynlink && $(MAKEREC) allopt
# The configuration file
utils/config.ml: utils/config.mlp config/Makefile

View File

@ -315,3 +315,21 @@ partialclean::
rm -f driver/compdynlink.mlbyte
rm -f driver/compdynlink.mli
rm -f driver/compdynlink.mlopt
# The native toplevel
compilerlibs/ocamlopttoplevel.cmxa: $(OPTTOPLEVEL:.cmo=.cmx)
$(CAMLOPT) -a -o $@ $(OPTTOPLEVEL:.cmo=.cmx)
partialclean::
rm -f compilerlibs/ocamlopttoplevel.cmxa
ocamlnat: compilerlibs/ocamlcommon.cmxa compilerlibs/ocamloptcomp.cmxa \
compilerlibs/ocamlbytecomp.cmxa \
compilerlibs/ocamlopttoplevel.cmxa \
$(OPTTOPLEVELSTART:.cmo=.cmx)
$(CAMLOPT) $(LINKFLAGS) -linkall -o $@ $^
partialclean::
rm -f ocamlnat
toplevel/opttoploop.cmx: otherlibs/dynlink/dynlink.cmxa