2 # Translator from Modelica 2.x to flat Modelica
\r
4 # Copyright (C) 2005 - 2007 Imagine S.A.
\r
5 # For more information or commercial use please contact us at www.amesim.com
\r
7 # This program is free software; you can redistribute it and/or
\r
8 # modify it under the terms of the GNU General Public License
\r
9 # as published by the Free Software Foundation; either version 2
\r
10 # of the License, or (at your option) any later version.
\r
12 # This program is distributed in the hope that it will be useful,
\r
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
15 # GNU General Public License for more details.
\r
17 # You should have received a copy of the GNU General Public License
\r
18 # along with this program; if not, write to the Free Software
\r
19 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
\r
29 ifeq ($(RELEASE),yes)
\r
30 OCAMLFLAGS=$(INCLUDES)
\r
32 OCAMLFLAGS=-g $(INCLUDES)
\r
35 OCAMLOPTFLAGS=$(INCLUDES)
\r
37 LIBSOPT=$(LIBS:.cma=.cmxa)
\r
38 SRCS=syntax.ml linenum.ml parser.ml lexer.ml
\r
41 OBJS=$(SRCS:.ml=.cmo)
\r
42 OBJSOPT=$(SRCS:.ml=.cmx)
\r
44 LIBOPT=$(LIB:.cma=.cmxa)
\r
46 .SUFFIXES: .ml .mli .cmo .cmi .cmx .mlp .mpi
\r
49 $(CAMLP4) pa_o.cmo pa_op.cmo pr_o.cmo -impl $< > $(@:.cmo=.tmp)
\r
50 $(OCAMLC) $(OCAMLFLAGS) -c -impl $(@:.cmo=.tmp)
\r
51 rm -f $(@:.cmo=.tmp)
\r
54 $(CAMLP4) pa_o.cmo pa_op.cmo pr_o.cmo -intf $< > $(@:.cmi=.tmp)
\r
55 $(OCAMLC) $(OCAMLFLAGS) -c -intf $(@:.cmi=.tmp)
\r
56 rm -f $(@:.cmi=.tmp)
\r
59 $(CAMLP4) pa_o.cmo pa_op.cmo pr_o.cmo -impl $< > $(@:.cmx=.tmp)
\r
60 $(OCAMLOPT) $(OCAMLOPTFLAGS) -c -impl $(@:.cmx=.tmp)
\r
61 rm -f $(@:.cmx=.tmp)
\r
64 $(OCAMLC) $(OCAMLFLAGS) -c $<
\r
67 $(OCAMLC) $(OCAMLFLAGS) -c $<
\r
70 $(OCAMLOPT) $(OCAMLOPTFLAGS) -c $<
\r
74 rm -f $(<:.mly=.mli)
\r
81 $(OCAMLOPT) $(OCAMLOPTFLAGS) -a -o $(LIBOPT) $(LFLAGS) $(LIBSOPT) $(OBJSOPT)
\r
84 $(OCAMLC) $(OCAMLFLAGS) -a -o $(LIB) $(LFLAGS) $(LIBS) $(OBJS)
\r
86 parser.ml : parser.mly
\r
87 ocamlyacc parser.mly
\r
90 lexer.ml : lexer.mll
\r
93 linenum.ml : linenum.mll
\r
94 ocamllex linenum.mll
\r
97 $(OCAMLDEP) $(INCLUDES) $(SRCS:.ml=.mli) $(SRCS) > .depend
\r
109 rm -f parser.output
\r