fix bug in clf, info_message does not exist on frame
[scilab.git] / scilab / modules / scicos / Makefile.modelica.am
1 # Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2 # Copyright (C) 2008 - INRIA - Sylvestre Ledru <sylvestre.ledru@inria.fr>
3 # Copyright (C) 2010 - DIGITEO - Sylvestre Ledru
4 #
5 # This file must be used under the terms of the CeCILL.
6 # This source file is licensed as described in the file COPYING, which
7 # you should have received as part of this distribution.  The terms
8 # are also available at
9 # http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
10
11 # TODO:
12 # * see if we can do more factorization (on the lexer for example)
13
14 ######### Common Modelica elements #############
15
16 if XCOS
17 if OCAML
18 TARGET = modelicac XML2Modelica modelicat
19 BASE_PATH = $(srcdir)/src/
20 bin_PROGRAMS = $(TARGET)
21 OCAMLLIBS=nums.cma
22
23
24 ### XML2Modelica
25
26 XML2Modelica_SOURCES = $(MLS_XML2Modelica)
27 MLS_XML2Modelica= $(srcdir)/src/xml2modelica/xMLTree.ml $(srcdir)/src/xml2modelica/linenum.ml $(srcdir)/src/xml2modelica/stringParser.ml $(srcdir)/src/xml2modelica/stringLexer.ml $(srcdir)/src/xml2modelica/xMLParser.ml $(srcdir)/src/xml2modelica/xMLLexer.ml\
28         $(srcdir)/src/xml2modelica/modelicaCodeGenerator.ml $(srcdir)/src/xml2modelica/xML2Modelica.ml
29
30 BASE_PATH_XML2Modelica = $(srcdir)/src/xml2modelica
31
32
33 ### Translator 
34
35 modelicat_SOURCES = \
36         $(srcdir)/src/translator/parsing/syntax.ml \
37         $(srcdir)/src/translator/parsing/parser.mly \
38         $(srcdir)/src/translator/parsing/lexer.mll \
39         $(srcdir)/src/translator/parsing/linenum.ml \
40         $(srcdir)/src/translator/compilation/types.ml \
41         $(srcdir)/src/translator/compilation/nameResolve.ml \
42         $(srcdir)/src/translator/instantiation/instantiation.ml \
43         $(srcdir)/src/translator/exceptionHandling/msgDico.ml \
44         $(srcdir)/src/translator/exceptionHandling/errorDico.ml \
45         $(srcdir)/src/translator/exceptionHandling/exceptHandler.ml \
46         $(srcdir)/src/translator/translation/libraryManager.ml \
47         $(srcdir)/src/translator/translation/codeGeneration.ml \
48         $(srcdir)/src/translator/translation/versiondate.ml \
49         $(srcdir)/src/translator/translation/translator.ml
50
51 modelicat_SOURCES_mly = $(modelicat_SOURCES:.mly=.ml)
52 MLS_modelicat = $(modelicat_SOURCES_mly:.mll=.ml)
53 MLIS_modelicat = $(MLS_modelicat:.ml=.mli)
54
55 INCLUDE_modelicat = -I $(srcdir)/src/translator/compilation \
56 -I $(srcdir)/src/translator/exceptionHandling \
57 -I $(srcdir)/src/translator/parsing \
58 -I $(srcdir)/src/translator/instantiation \
59 -I $(srcdir)/src/translator/translation
60
61 ### Modelicac
62
63 modelicac_SOURCES = \
64         $(srcdir)/src/modelica_compiler/parseTree.ml \
65         $(srcdir)/src/modelica_compiler/linenum.ml \
66         $(srcdir)/src/modelica_compiler/parser.mly \
67         $(srcdir)/src/modelica_compiler/lexer.mll \
68         $(srcdir)/src/modelica_compiler/precompilation.ml \
69         $(srcdir)/src/modelica_compiler/compilation.ml \
70         $(srcdir)/src/modelica_compiler/instantiation.ml \
71         $(srcdir)/src/modelica_compiler/graphNodeSet.ml \
72         $(srcdir)/src/modelica_compiler/symbolicExpression.ml \
73         $(srcdir)/src/modelica_compiler/squareSparseMatrix.ml \
74         $(srcdir)/src/modelica_compiler/bipartiteGraph.ml \
75         $(srcdir)/src/modelica_compiler/hungarianMethod.ml \
76         $(srcdir)/src/modelica_compiler/causalityGraph.ml \
77         $(srcdir)/src/modelica_compiler/optimization.ml \
78         $(srcdir)/src/modelica_compiler/xMLCodeGeneration.ml \
79         $(srcdir)/src/modelica_compiler/optimizingCompiler.ml \
80         $(srcdir)/src/modelica_compiler/scicosCodeGeneration.ml \
81         $(srcdir)/src/modelica_compiler/scicosOptimizingCompiler.ml
82
83 modelicac_SOURCES_mly = $(modelicac_SOURCES:.mly=.ml)
84 MLS = $(modelicac_SOURCES_mly:.mll=.ml)
85 MLIS = $(MLS:.ml=.mli)
86
87 BASE_PATH_MODELICAC = $(srcdir)/src/modelica_compiler
88
89 INCLUDE = -I $(BASE_PATH_MODELICAC) -I $(BASE_PATH_XML2Modelica)
90
91 ########## COMMON
92 SUFFIXES += .ml .mli .mll .mly .cmo .cmi .cmx
93
94 # @TODO check how to avoid the rebuild of the parser/lexer
95
96 %.cmo: %.ml %.cmi
97         @if echo "$<"|grep src/translator; then \
98                 echo $(OCAMLC) $(INCLUDE_modelicat)  -c $<; \
99                 $(OCAMLC) $(INCLUDE_modelicat)  -c $<; \
100         else \
101                 echo $(OCAMLC) $(INCLUDE)  -c $<; \
102                 $(OCAMLC) $(INCLUDE)  -c $<; \
103         fi
104
105 .ml.cmx:
106         @if echo "$<"|grep src/translator; then \
107                 echo $(OCAMLOPT) $(INCLUDE_modelicat) -c $<; \
108                 $(OCAMLOPT) $(INCLUDE_modelicat) -c $<; \
109         else \
110                 echo $(OCAMLOPT) $(INCLUDE) -c $<; \
111                 $(OCAMLOPT) $(INCLUDE) -c $<; \
112         fi
113
114
115 .mli.cmi:
116         @if echo "$<"|grep src/translator; then \
117                 echo $(OCAMLC) $(INCLUDE_modelicat) -c $<; \
118                 $(OCAMLC) $(INCLUDE_modelicat) -c $<; \
119         else \
120                 echo $(OCAMLC) $(INCLUDE) -c $<; \
121                 $(OCAMLC) $(INCLUDE) -c $<; \
122         fi
123
124 .ml.mli:
125         @if echo "$<"|grep src/translator; then \
126                 echo $(OCAMLC) $(INCLUDE_modelicat) -i $< > $@; \
127                 $(OCAMLC) $(INCLUDE_modelicat) -i $< > $@; \
128         else \
129                 echo $(OCAMLC) $(INCLUDE) -i $< > $@; \
130                 $(OCAMLC) $(INCLUDE) -i $< > $@; \
131         fi
132
133
134 .mll.ml:
135         $(OCAMLLEX) $<
136
137 .mly.ml:
138         $(OCAMLYACC) $<
139
140 # Build the binaries
141
142 modelicac:$(MLIS:.mli=.cmi) $(MLS:.ml=.cmo) $(MLS:.ml=.cmx)
143         $(OCAMLOPT) -o modelicac $(INCLUDE) $(OCAMLLIBS:.cma=.cmxa) $(MLS:.ml=.cmx)
144
145
146 XML2Modelica: $(MLS_XML2Modelica:.ml=.cmo) $(MLS_XML2Modelica:.ml=.cmx) 
147         $(OCAMLOPT) -o XML2Modelica $(INCLUDE) $(OCAMLLIBS:.cma=.cmxa) $(MLS_XML2Modelica:.ml=.cmx) 
148
149 modelicat: $(MLIS_modelicat:.mli=.cmi) $(MLS_modelicat:.ml=.cmo) $(MLS_modelicat:.ml=.cmx)
150         $(OCAMLOPT) -o modelicat $(INCLUDE_modelicat) $(OCAMLLIBS:.cma=.cmxa) $(MLS_SPECIFIC_PRE_modelicat:.ml=.cmx) $(MLS_modelicat:.ml=.cmx) 
151
152
153 CLEANFILES = $(BASE_PATH)/*/*.cmi \
154         $(BASE_PATH)/*/*.o \
155         $(BASE_PATH)/*/*.cmo \
156         $(BASE_PATH)/*/*.cm[aiox] \
157         $(BASE_PATH)/*/parser.mli \
158         $(BASE_PATH)/*/lexer.mli \
159         $(BASE_PATH)/*/parser.ml \
160         $(BASE_PATH)/*/lexer.ml \
161         $(BASE_PATH)/translator/*/*.cmi \
162         $(BASE_PATH)/translator/*/*.o \
163         $(BASE_PATH)/translator/*/*.a \
164         $(BASE_PATH)/translator/*/*.cmo \
165         $(BASE_PATH)/translator/*/*.cmxa \
166         $(BASE_PATH)/translator/*/*.cm[aiox] \
167         $(BASE_PATH)/translator/*/parser.mli \
168         $(BASE_PATH)/translator/*/lexer.mli \
169         $(BASE_PATH)/translator/*/parser.ml \
170         $(BASE_PATH)/translator/*/linenum.ml \
171         $(BASE_PATH)/translator/*/lexer.ml \
172         $(TARGET) \
173         $(BASE_PATH)/modelica_compiler/linenum.mli \
174         $(BASE_PATH)/modelica_compiler/scicosOptimizingCompiler.mli \
175         $(BASE_PATH)/translator/compilation/nameResolve.mli \
176         $(BASE_PATH)/translator/compilation/types.mli \
177         $(BASE_PATH)/translator/exceptionHandling/errorDico.mli \
178         $(BASE_PATH)/translator/exceptionHandling/exceptHandler.mli \
179         $(BASE_PATH)/translator/exceptionHandling/msgDico.mli \
180         $(BASE_PATH)/translator/instantiation/instantiation.mli \
181         $(BASE_PATH)/translator/parsing/linenum.mli \
182         $(BASE_PATH)/translator/parsing/syntax.mli \
183         $(BASE_PATH)/translator/translation/codeGeneration.mli \
184         $(BASE_PATH)/translator/translation/libraryManager.mli \
185         $(BASE_PATH)/translator/translation/translator.mli \
186         $(BASE_PATH)/translator/translation/versiondate.mli
187
188 #BUILT_SOURCES = depend
189
190 depend: 
191         $(OCAMLDEP) $(INCLUDE_modelicat) $(INCLUDE) $(MLIS) $(MLS) $(MLIS_XML2Modelica) $(MLS_XML2Modelica) $(MLIS_modelicat) $(MLS_modelicat) > .depend
192
193 include .depend
194
195 endif # OCAML
196 endif # XCOS