Bump version numbers to 6.2.0
[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 # Copyright (C) 2014 - Scilab Enterprises - Clement DAVID
5 # Copyright (C) 2018 - ESI Group - Clement DAVID
6 #
7 # Copyright (C) 2012 - 2016 - Scilab Enterprises
8 #
9 # This file is hereby licensed under the terms of the GNU GPL v2.0,
10 # pursuant to article 5.3.4 of the CeCILL v.2.1.
11 # This file was originally licensed under the terms of the CeCILL v2.1,
12 # and continues to be available under such terms.
13 # For more information, see the COPYING file which you should have received
14 # along with this program.
15
16 # TODO:
17 # * see if we can do more factorization (on the lexer for example)
18
19 ######### Common Modelica elements #############
20
21 if XCOS
22 if OCAML
23 TARGET = modelicac XML2Modelica modelicat
24 BASE_PATH = $(srcdir)/src/
25 bin_PROGRAMS = $(TARGET)
26 OCAMLLIBS=nums.cma
27
28
29 ### XML2Modelica
30
31 XML2Modelica_SOURCES = \
32         $(srcdir)/src/xml2modelica/xMLTree.ml \
33         $(srcdir)/src/modelica_compiler/linenum.mll \
34         $(srcdir)/src/xml2modelica/stringParser.ml \
35         $(srcdir)/src/xml2modelica/stringLexer.ml \
36         $(srcdir)/src/xml2modelica/xMLParser.ml \
37         $(srcdir)/src/xml2modelica/xMLLexer.ml \
38         $(srcdir)/src/xml2modelica/modelicaCodeGenerator.ml \
39         $(srcdir)/src/xml2modelica/xML2Modelica.ml
40
41 XML2Modelica_SOURCES_mly = $(XML2Modelica_SOURCES:.mly=.ml)
42 MLS_XML2Modelica = $(XML2Modelica_SOURCES_mly:.mll=.ml)
43
44 BASE_PATH_XML2Modelica = $(srcdir)/src/xml2modelica
45
46
47 ### Translator
48
49 modelicat_SOURCES = \
50         $(srcdir)/src/translator/parsing/syntax.ml \
51         $(srcdir)/src/translator/parsing/parser.mly \
52         $(srcdir)/src/translator/parsing/lexer.mll \
53         $(srcdir)/src/translator/parsing/linenum.mll \
54         $(srcdir)/src/translator/compilation/types.ml \
55         $(srcdir)/src/translator/compilation/nameResolve.ml \
56         $(srcdir)/src/translator/instantiation/instantiation.ml \
57         $(srcdir)/src/translator/exceptionHandling/msgDico.ml \
58         $(srcdir)/src/translator/exceptionHandling/errorDico.ml \
59         $(srcdir)/src/translator/exceptionHandling/exceptHandler.ml \
60         $(srcdir)/src/translator/translation/libraryManager.ml \
61         $(srcdir)/src/translator/translation/codeGeneration.ml \
62         $(srcdir)/src/translator/translation/versiondate.ml \
63         $(srcdir)/src/translator/translation/translator.ml
64
65 modelicat_SOURCES_mly = $(modelicat_SOURCES:.mly=.ml)
66 MLS_modelicat = $(modelicat_SOURCES_mly:.mll=.ml)
67
68 INCLUDE_modelicat = -I $(srcdir)/src/translator/compilation \
69 -I $(srcdir)/src/translator/exceptionHandling \
70 -I $(srcdir)/src/translator/parsing \
71 -I $(srcdir)/src/translator/instantiation \
72 -I $(srcdir)/src/translator/translation
73
74 ### Modelicac
75
76 modelicac_SOURCES = \
77         $(srcdir)/src/modelica_compiler/parseTree.ml \
78         $(srcdir)/src/modelica_compiler/linenum.mll \
79         $(srcdir)/src/modelica_compiler/parser.mly \
80         $(srcdir)/src/modelica_compiler/lexer.mll \
81         $(srcdir)/src/modelica_compiler/precompilation.ml \
82         $(srcdir)/src/modelica_compiler/compilation.ml \
83         $(srcdir)/src/modelica_compiler/instantiation.ml \
84         $(srcdir)/src/modelica_compiler/graphNodeSet.ml \
85         $(srcdir)/src/modelica_compiler/symbolicExpression.ml \
86         $(srcdir)/src/modelica_compiler/squareSparseMatrix.ml \
87         $(srcdir)/src/modelica_compiler/bipartiteGraph.ml \
88         $(srcdir)/src/modelica_compiler/hungarianMethod.ml \
89         $(srcdir)/src/modelica_compiler/causalityGraph.ml \
90         $(srcdir)/src/modelica_compiler/optimization.ml \
91         $(srcdir)/src/modelica_compiler/xMLCodeGeneration.ml \
92         $(srcdir)/src/modelica_compiler/optimizingCompiler.ml \
93         $(srcdir)/src/modelica_compiler/scicosCodeGeneration.ml \
94         $(srcdir)/src/modelica_compiler/scicosOptimizingCompiler.ml
95
96 modelicac_SOURCES_mly = $(modelicac_SOURCES:.mly=.ml)
97 MLS_modelicac = $(modelicac_SOURCES_mly:.mll=.ml)
98
99 BASE_PATH_MODELICAC = $(srcdir)/src/modelica_compiler
100
101 INCLUDE = -I $(BASE_PATH_MODELICAC) -I $(BASE_PATH_XML2Modelica)
102
103 ########## COMMON
104 SUFFIXES += .mll .mly
105
106 .mll.ml:
107         $(OCAMLLEX) $<
108
109 .mly.ml:
110         $(OCAMLYACC) $<
111         @rm $*.mli
112
113 # Build the binaries, disabling parallel building as ocamldep ordering seems to fail on some systems
114
115 modelicac: $(modelicac_SOURCES) $(MLS_modelicac)
116         /usr/bin/time $(OCAMLOPT) -o $@ $(INCLUDE) $(OCAMLOPTFLAGS) $(OCAMLLIBS:.cma=.cmxa) $(MLS_modelicac)
117
118 modelicac.ocamlc: $(modelicac_SOURCES) $(MLS_modelicac)
119         $(OCAMLC) -o $@ $(INCLUDE) $(OCAMLOPTFLAGS) $(OCAMLLIBS) $(MLS_modelicac)
120
121 XML2Modelica: $(XML2Modelica_SOURCES) $(MLS_XML2Modelica)
122         $(OCAMLOPT) -o $@ $(INCLUDE) $(OCAMLCFLAGS) $(OCAMLLIBS:.cma=.cmxa) $(MLS_XML2Modelica)
123
124 XML2Modelica.ocamlc: $(XML2Modelica_SOURCES) $(MLS_XML2Modelica)
125         $(OCAMLC) -o $@ $(INCLUDE) $(OCAMLCFLAGS) $(OCAMLLIBS) $(MLS_XML2Modelica)
126
127 modelicat: $(modelicat_SOURCES) $(MLS_modelicat)
128         $(OCAMLOPT) -o $@ $(INCLUDE_modelicat) $(OCAMLOPTFLAGS) $(OCAMLLIBS:.cma=.cmxa) $(MLS_modelicat)
129
130 modelicat.ocamlc: $(modelicat_SOURCES) $(MLS_modelicat)
131         $(OCAMLC) -o $@ $(INCLUDE_modelicat) $(OCAMLOPTFLAGS) $(OCAMLLIBS) $(MLS_modelicat)
132
133 CLEANFILES = $(BASE_PATH)/*/*.cmi \
134         $(BASE_PATH)/*/*.o \
135         $(BASE_PATH)/*/*.cmo \
136         $(BASE_PATH)/*/*.cm[aiox] \
137         $(BASE_PATH)/*/parser.mli \
138         $(BASE_PATH)/*/lexer.mli \
139         $(BASE_PATH)/*/linenum.mli \
140         $(BASE_PATH)/*/parser.ml \
141         $(BASE_PATH)/*/lexer.ml \
142         $(BASE_PATH)/*/linenum.ml \
143         $(BASE_PATH)/translator/*/*.cmi \
144         $(BASE_PATH)/translator/*/*.o \
145         $(BASE_PATH)/translator/*/*.a \
146         $(BASE_PATH)/translator/*/*.cmo \
147         $(BASE_PATH)/translator/*/*.cmxa \
148         $(BASE_PATH)/translator/*/*.cm[aiox] \
149         $(BASE_PATH)/translator/*/parser.mli \
150         $(BASE_PATH)/translator/*/lexer.mli \
151         $(BASE_PATH)/translator/*/parser.ml \
152         $(BASE_PATH)/translator/*/linenum.ml \
153         $(BASE_PATH)/translator/*/lexer.ml \
154         $(TARGET) \
155         $(BASE_PATH)/modelica_compiler/linenum.mli \
156         $(BASE_PATH)/modelica_compiler/scicosOptimizingCompiler.mli \
157         $(BASE_PATH)/translator/compilation/nameResolve.mli \
158         $(BASE_PATH)/translator/compilation/types.mli \
159         $(BASE_PATH)/translator/exceptionHandling/errorDico.mli \
160         $(BASE_PATH)/translator/exceptionHandling/exceptHandler.mli \
161         $(BASE_PATH)/translator/exceptionHandling/msgDico.mli \
162         $(BASE_PATH)/translator/instantiation/instantiation.mli \
163         $(BASE_PATH)/translator/parsing/linenum.mli \
164         $(BASE_PATH)/translator/parsing/syntax.mli \
165         $(BASE_PATH)/translator/translation/codeGeneration.mli \
166         $(BASE_PATH)/translator/translation/libraryManager.mli \
167         $(BASE_PATH)/translator/translation/translator.mli \
168         $(BASE_PATH)/translator/translation/versiondate.mli
169
170 endif # OCAML
171 endif # XCOS