Scicos OCaml part: generated bytecode executables 25/14025/2
Clément DAVID [Wed, 12 Mar 2014 15:04:53 +0000 (16:04 +0100)]
Using bytecode executable instead of natives ones ease OCaml debugging.
Note that these executable are not embedded into the Scilab binary version to
avoid duplication.

Change-Id: I38e7fd481cf3bc9c245cb18c74c8eaccd6982f03

scilab/modules/scicos/.gitignore
scilab/modules/scicos/Makefile.in
scilab/modules/scicos/Makefile.modelica.am

index 89cc584..00bdf74 100644 (file)
@@ -1,4 +1,7 @@
+# ignore some generated files
+
 modelicac
+modelicac.ocamlc
 *.cmi
 *.cma
 *.cmo
@@ -20,11 +23,13 @@ src/modelica_compiler/*.obj
 *.mli
 
 XML2Modelica
+XML2Modelica.ocamlc
 xml2modelica.exe
 
 
 #translator
 modelicat
+modelicat.ocamlc
 modelicat.exe
 src/translator/*/*.a
 src/translator/parsing/lexer.ml
index ebf4ad8..630e634 100644 (file)
@@ -3300,38 +3300,38 @@ distclean-local:
 
 @OCAML_TRUE@@XCOS_TRUE@%.cmo: %.ml %.cmi
 @OCAML_TRUE@@XCOS_TRUE@        @if echo "$<"|grep src/translator; then \
-@OCAML_TRUE@@XCOS_TRUE@                echo $(OCAMLC) $(INCLUDE_modelicat)  -c $<; \
-@OCAML_TRUE@@XCOS_TRUE@                $(OCAMLC) $(INCLUDE_modelicat)  -c $<; \
+@OCAML_TRUE@@XCOS_TRUE@                echo $(OCAMLC) $(INCLUDE_modelicat) $(OCAMLCFLAGS) -c $<; \
+@OCAML_TRUE@@XCOS_TRUE@                $(OCAMLC) $(INCLUDE_modelicat) $(OCAMLCFLAGS) -c $<; \
 @OCAML_TRUE@@XCOS_TRUE@        else \
-@OCAML_TRUE@@XCOS_TRUE@                echo $(OCAMLC) $(INCLUDE)  -c $<; \
-@OCAML_TRUE@@XCOS_TRUE@                $(OCAMLC) $(INCLUDE)  -c $<; \
+@OCAML_TRUE@@XCOS_TRUE@                echo $(OCAMLC) $(INCLUDE) $(OCAMLCFLAGS) -c $<; \
+@OCAML_TRUE@@XCOS_TRUE@                $(OCAMLC) $(INCLUDE) $(OCAMLCFLAGS) -c $<; \
 @OCAML_TRUE@@XCOS_TRUE@        fi
 
 @OCAML_TRUE@@XCOS_TRUE@.ml.cmx:
 @OCAML_TRUE@@XCOS_TRUE@        @if echo "$<"|grep src/translator; then \
-@OCAML_TRUE@@XCOS_TRUE@                echo $(OCAMLOPT) $(INCLUDE_modelicat) -c $<; \
-@OCAML_TRUE@@XCOS_TRUE@                $(OCAMLOPT) $(INCLUDE_modelicat) -c $<; \
+@OCAML_TRUE@@XCOS_TRUE@                echo $(OCAMLOPT) $(INCLUDE_modelicat) $(OCAMLOPTFLAGS) -c $<; \
+@OCAML_TRUE@@XCOS_TRUE@                $(OCAMLOPT) $(INCLUDE_modelicat) $(OCAMLOPTFLAGS) -c $<; \
 @OCAML_TRUE@@XCOS_TRUE@        else \
-@OCAML_TRUE@@XCOS_TRUE@                echo $(OCAMLOPT) $(INCLUDE) -c $<; \
-@OCAML_TRUE@@XCOS_TRUE@                $(OCAMLOPT) $(INCLUDE) -c $<; \
+@OCAML_TRUE@@XCOS_TRUE@                echo $(OCAMLOPT) $(INCLUDE) $(OCAMLOPTFLAGS) -c $<; \
+@OCAML_TRUE@@XCOS_TRUE@                $(OCAMLOPT) $(INCLUDE) $(OCAMLOPTFLAGS) -c $<; \
 @OCAML_TRUE@@XCOS_TRUE@        fi
 
 @OCAML_TRUE@@XCOS_TRUE@.mli.cmi:
 @OCAML_TRUE@@XCOS_TRUE@        @if echo "$<"|grep src/translator; then \
-@OCAML_TRUE@@XCOS_TRUE@                echo $(OCAMLC) $(INCLUDE_modelicat) -c $<; \
-@OCAML_TRUE@@XCOS_TRUE@                $(OCAMLC) $(INCLUDE_modelicat) -c $<; \
+@OCAML_TRUE@@XCOS_TRUE@                echo $(OCAMLC) $(INCLUDE_modelicat) $(OCAMLCFLAGS) -c $<; \
+@OCAML_TRUE@@XCOS_TRUE@                $(OCAMLC) $(INCLUDE_modelicat) $(OCAMLCFLAGS) -c $<; \
 @OCAML_TRUE@@XCOS_TRUE@        else \
-@OCAML_TRUE@@XCOS_TRUE@                echo $(OCAMLC) $(INCLUDE) -c $<; \
-@OCAML_TRUE@@XCOS_TRUE@                $(OCAMLC) $(INCLUDE) -c $<; \
+@OCAML_TRUE@@XCOS_TRUE@                echo $(OCAMLC) $(INCLUDE) $(OCAMLCFLAGS) -c $<; \
+@OCAML_TRUE@@XCOS_TRUE@                $(OCAMLC) $(INCLUDE) $(OCAMLCFLAGS) -c $<; \
 @OCAML_TRUE@@XCOS_TRUE@        fi
 
 @OCAML_TRUE@@XCOS_TRUE@.ml.mli:
 @OCAML_TRUE@@XCOS_TRUE@        @if echo "$<"|grep src/translator; then \
-@OCAML_TRUE@@XCOS_TRUE@                echo $(OCAMLC) $(INCLUDE_modelicat) -i $< > $@; \
-@OCAML_TRUE@@XCOS_TRUE@                $(OCAMLC) $(INCLUDE_modelicat) -i $< > $@; \
+@OCAML_TRUE@@XCOS_TRUE@                echo $(OCAMLC) $(INCLUDE_modelicat) $(OCAMLCFLAGS) -i $< > $@; \
+@OCAML_TRUE@@XCOS_TRUE@                $(OCAMLC) $(INCLUDE_modelicat) $(OCAMLCFLAGS) -i $< > $@; \
 @OCAML_TRUE@@XCOS_TRUE@        else \
-@OCAML_TRUE@@XCOS_TRUE@                echo $(OCAMLC) $(INCLUDE) -i $< > $@; \
-@OCAML_TRUE@@XCOS_TRUE@                $(OCAMLC) $(INCLUDE) -i $< > $@; \
+@OCAML_TRUE@@XCOS_TRUE@                echo $(OCAMLC) $(INCLUDE) $(OCAMLCFLAGS) -i $< > $@; \
+@OCAML_TRUE@@XCOS_TRUE@                $(OCAMLC) $(INCLUDE) $(OCAMLCFLAGS) -i $< > $@; \
 @OCAML_TRUE@@XCOS_TRUE@        fi
 
 @OCAML_TRUE@@XCOS_TRUE@.mll.ml:
@@ -3342,14 +3342,23 @@ distclean-local:
 
 # Build the binaries
 
-@OCAML_TRUE@@XCOS_TRUE@modelicac:$(MLIS:.mli=.cmi) $(MLS:.ml=.cmo) $(MLS:.ml=.cmx)
-@OCAML_TRUE@@XCOS_TRUE@        $(OCAMLOPT) -o modelicac $(INCLUDE) $(OCAMLLIBS:.cma=.cmxa) $(MLS:.ml=.cmx)
+@OCAML_TRUE@@XCOS_TRUE@modelicac: $(MLS:.ml=.cmx)
+@OCAML_TRUE@@XCOS_TRUE@        $(OCAMLOPT) -o $@ $(INCLUDE) $(OCAMLOPTFLAGS) $(OCAMLLIBS:.cma=.cmxa) $^
 
-@OCAML_TRUE@@XCOS_TRUE@XML2Modelica: $(MLS_XML2Modelica:.ml=.cmo) $(MLS_XML2Modelica:.ml=.cmx) 
-@OCAML_TRUE@@XCOS_TRUE@        $(OCAMLOPT) -o XML2Modelica $(INCLUDE) $(OCAMLLIBS:.cma=.cmxa) $(MLS_XML2Modelica:.ml=.cmx) 
+@OCAML_TRUE@@XCOS_TRUE@modelicac.ocamlc: $(MLS:.ml=.cmo)
+@OCAML_TRUE@@XCOS_TRUE@        $(OCAMLC) -o $@ $(INCLUDE) $(OCAMLOPTFLAGS) $(OCAMLLIBS) $^
 
-@OCAML_TRUE@@XCOS_TRUE@modelicat: $(MLIS_modelicat:.mli=.cmi) $(MLS_modelicat:.ml=.cmo) $(MLS_modelicat:.ml=.cmx)
-@OCAML_TRUE@@XCOS_TRUE@        $(OCAMLOPT) -o modelicat $(INCLUDE_modelicat) $(OCAMLLIBS:.cma=.cmxa) $(MLS_SPECIFIC_PRE_modelicat:.ml=.cmx) $(MLS_modelicat:.ml=.cmx) 
+@OCAML_TRUE@@XCOS_TRUE@XML2Modelica: $(MLS_XML2Modelica:.ml=.cmx) 
+@OCAML_TRUE@@XCOS_TRUE@        $(OCAMLOPT) -o $@ $(INCLUDE) $(OCAMLCFLAGS) $(OCAMLLIBS:.cma=.cmxa) $^
+
+@OCAML_TRUE@@XCOS_TRUE@XML2Modelica.ocamlc: $(MLS_XML2Modelica:.ml=.cmo)
+@OCAML_TRUE@@XCOS_TRUE@        $(OCAMLC) -o $@ $(INCLUDE) $(OCAMLCFLAGS) $(OCAMLLIBS) $^
+
+@OCAML_TRUE@@XCOS_TRUE@modelicat: $(MLS_SPECIFIC_PRE_modelicat:.ml=.cmx) $(MLS_modelicat:.ml=.cmx)
+@OCAML_TRUE@@XCOS_TRUE@        $(OCAMLOPT) -o $@ $(INCLUDE_modelicat) $(OCAMLOPTFLAGS) $(OCAMLLIBS:.cma=.cmxa) $^
+
+@OCAML_TRUE@@XCOS_TRUE@modelicat.ocamlc: $(MLS_SPECIFIC_PRE_modelicat:.ml=.cmo) $(MLS_modelicat:.ml=.cmo)
+@OCAML_TRUE@@XCOS_TRUE@        $(OCAMLC) -o $@ $(INCLUDE_modelicat) $(OCAMLOPTFLAGS) $(OCAMLLIBS) $^
 
 #BUILT_SOURCES = depend
 
index 56149a2..d4807e4 100644 (file)
@@ -95,42 +95,40 @@ SUFFIXES += .ml .mli .mll .mly .cmo .cmi .cmx
 
 %.cmo: %.ml %.cmi
        @if echo "$<"|grep src/translator; then \
-               echo $(OCAMLC) $(INCLUDE_modelicat)  -c $<; \
-               $(OCAMLC) $(INCLUDE_modelicat)  -c $<; \
+               echo $(OCAMLC) $(INCLUDE_modelicat) $(OCAMLCFLAGS) -c $<; \
+               $(OCAMLC) $(INCLUDE_modelicat) $(OCAMLCFLAGS) -c $<; \
        else \
-               echo $(OCAMLC) $(INCLUDE)  -c $<; \
-               $(OCAMLC) $(INCLUDE)  -c $<; \
+               echo $(OCAMLC) $(INCLUDE) $(OCAMLCFLAGS) -c $<; \
+               $(OCAMLC) $(INCLUDE) $(OCAMLCFLAGS) -c $<; \
        fi
 
 .ml.cmx:
        @if echo "$<"|grep src/translator; then \
-               echo $(OCAMLOPT) $(INCLUDE_modelicat) -c $<; \
-               $(OCAMLOPT) $(INCLUDE_modelicat) -c $<; \
+               echo $(OCAMLOPT) $(INCLUDE_modelicat) $(OCAMLOPTFLAGS) -c $<; \
+               $(OCAMLOPT) $(INCLUDE_modelicat) $(OCAMLOPTFLAGS) -c $<; \
        else \
-               echo $(OCAMLOPT) $(INCLUDE) -c $<; \
-               $(OCAMLOPT) $(INCLUDE) -c $<; \
+               echo $(OCAMLOPT) $(INCLUDE) $(OCAMLOPTFLAGS) -c $<; \
+               $(OCAMLOPT) $(INCLUDE) $(OCAMLOPTFLAGS) -c $<; \
        fi
 
-
 .mli.cmi:
        @if echo "$<"|grep src/translator; then \
-               echo $(OCAMLC) $(INCLUDE_modelicat) -c $<; \
-               $(OCAMLC) $(INCLUDE_modelicat) -c $<; \
+               echo $(OCAMLC) $(INCLUDE_modelicat) $(OCAMLCFLAGS) -c $<; \
+               $(OCAMLC) $(INCLUDE_modelicat) $(OCAMLCFLAGS) -c $<; \
        else \
-               echo $(OCAMLC) $(INCLUDE) -c $<; \
-               $(OCAMLC) $(INCLUDE) -c $<; \
+               echo $(OCAMLC) $(INCLUDE) $(OCAMLCFLAGS) -c $<; \
+               $(OCAMLC) $(INCLUDE) $(OCAMLCFLAGS) -c $<; \
        fi
 
 .ml.mli:
        @if echo "$<"|grep src/translator; then \
-               echo $(OCAMLC) $(INCLUDE_modelicat) -i $< > $@; \
-               $(OCAMLC) $(INCLUDE_modelicat) -i $< > $@; \
+               echo $(OCAMLC) $(INCLUDE_modelicat) $(OCAMLCFLAGS) -i $< > $@; \
+               $(OCAMLC) $(INCLUDE_modelicat) $(OCAMLCFLAGS) -i $< > $@; \
        else \
-               echo $(OCAMLC) $(INCLUDE) -i $< > $@; \
-               $(OCAMLC) $(INCLUDE) -i $< > $@; \
+               echo $(OCAMLC) $(INCLUDE) $(OCAMLCFLAGS) -i $< > $@; \
+               $(OCAMLC) $(INCLUDE) $(OCAMLCFLAGS) -i $< > $@; \
        fi
 
-
 .mll.ml:
        $(OCAMLLEX) $<
 
@@ -139,16 +137,23 @@ SUFFIXES += .ml .mli .mll .mly .cmo .cmi .cmx
 
 # Build the binaries
 
-modelicac:$(MLIS:.mli=.cmi) $(MLS:.ml=.cmo) $(MLS:.ml=.cmx)
-       $(OCAMLOPT) -o modelicac $(INCLUDE) $(OCAMLLIBS:.cma=.cmxa) $(MLS:.ml=.cmx)
+modelicac: $(MLS:.ml=.cmx)
+       $(OCAMLOPT) -o $@ $(INCLUDE) $(OCAMLOPTFLAGS) $(OCAMLLIBS:.cma=.cmxa) $^
+
+modelicac.ocamlc: $(MLS:.ml=.cmo)
+       $(OCAMLC) -o $@ $(INCLUDE) $(OCAMLOPTFLAGS) $(OCAMLLIBS) $^
 
+XML2Modelica: $(MLS_XML2Modelica:.ml=.cmx) 
+       $(OCAMLOPT) -o $@ $(INCLUDE) $(OCAMLCFLAGS) $(OCAMLLIBS:.cma=.cmxa) $^
 
-XML2Modelica: $(MLS_XML2Modelica:.ml=.cmo) $(MLS_XML2Modelica:.ml=.cmx) 
-       $(OCAMLOPT) -o XML2Modelica $(INCLUDE) $(OCAMLLIBS:.cma=.cmxa) $(MLS_XML2Modelica:.ml=.cmx) 
+XML2Modelica.ocamlc: $(MLS_XML2Modelica:.ml=.cmo)
+       $(OCAMLC) -o $@ $(INCLUDE) $(OCAMLCFLAGS) $(OCAMLLIBS) $^
 
-modelicat: $(MLIS_modelicat:.mli=.cmi) $(MLS_modelicat:.ml=.cmo) $(MLS_modelicat:.ml=.cmx)
-       $(OCAMLOPT) -o modelicat $(INCLUDE_modelicat) $(OCAMLLIBS:.cma=.cmxa) $(MLS_SPECIFIC_PRE_modelicat:.ml=.cmx) $(MLS_modelicat:.ml=.cmx) 
+modelicat: $(MLS_SPECIFIC_PRE_modelicat:.ml=.cmx) $(MLS_modelicat:.ml=.cmx)
+       $(OCAMLOPT) -o $@ $(INCLUDE_modelicat) $(OCAMLOPTFLAGS) $(OCAMLLIBS:.cma=.cmxa) $^
 
+modelicat.ocamlc: $(MLS_SPECIFIC_PRE_modelicat:.ml=.cmo) $(MLS_modelicat:.ml=.cmo)
+       $(OCAMLC) -o $@ $(INCLUDE_modelicat) $(OCAMLOPTFLAGS) $(OCAMLLIBS) $^
 
 CLEANFILES = $(BASE_PATH)/*/*.cmi \
        $(BASE_PATH)/*/*.o \