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
28 INCLUDES=-I ../parsing -I ../compilation -I ../instantiation -I ../exceptionHandling
\r
30 ifeq ($(RELEASE),yes)
\r
31 OCAMLFLAGS=$(INCLUDES)
\r
33 OCAMLFLAGS=-g $(INCLUDES)
\r
36 OCAMLOPTFLAGS=$(INCLUDES)
\r
37 LIBS=../parsing/parsing.cma ../compilation/compilation.cma \
\r
38 ../instantiation/instantiation.cma ../exceptionHandling/exceptionHandling.cma \
\r
40 LIBSOPT=$(LIBS:.cma=.cmxa)
\r
42 SRCS=codeGeneration.ml libraryManager.ml versiondate.ml
\r
45 OBJS=$(SRCS:.ml=.cmo)
\r
46 OBJSOPT=$(SRCS:.ml=.cmx)
\r
48 # Avoid problems with svn command
\r
52 SVNLASTCHANGEDATESTR:=$(shell svn info .. | grep "Last Changed Date:")
\r
53 SVNLASTCHANGEREVSTR:=$(shell svn info .. | grep "Last Changed Rev:")
\r
55 .SUFFIXES: .ml .mli .cmo .cmi .cmx .mlp .mpi
\r
58 $(CAMLP4) pa_o.cmo pa_op.cmo pr_o.cmo -impl $< > $(@:.cmo=.tmp)
\r
59 $(OCAMLC) $(OCAMLFLAGS) -c -impl $(@:.cmo=.tmp)
\r
60 rm -f $(@:.cmo=.tmp)
\r
63 $(CAMLP4) pa_o.cmo pa_op.cmo pr_o.cmo -intf $< > $(@:.cmi=.tmp)
\r
64 $(OCAMLC) $(OCAMLFLAGS) -c -intf $(@:.cmi=.tmp)
\r
65 rm -f $(@:.cmi=.tmp)
\r
68 $(CAMLP4) pa_o.cmo pa_op.cmo pr_o.cmo -impl $< > $(@:.cmx=.tmp)
\r
69 $(OCAMLOPT) $(OCAMLOPTFLAGS) -c -impl $(@:.cmx=.tmp)
\r
70 rm -f $(@:.cmx=.tmp)
\r
73 $(OCAMLC) $(OCAMLFLAGS) -c $<
\r
76 $(OCAMLC) $(OCAMLFLAGS) -c $<
\r
79 $(OCAMLOPT) $(OCAMLOPTFLAGS) -c $<
\r
85 $(OCAMLOPT) -verbose $(OCAMLOPTFLAGS) -o $(EXE) $(LFLAGS) $(LIBSOPT) $(OBJSOPT) translator.ml
90 $(OCAMLC) $(OCAMLFLAGS) -o $(EXE) $(LFLAGS) $(LIBS) $(OBJS) translator.ml
\r
93 $(OCAMLC) -verbose -custom $(OCAMLFLAGS) -o $(EXE) $(LFLAGS) $(LIBS) $(OBJS) translator.ml
\r
95 depend: version $(SRCS)
\r
96 $(OCAMLDEP) $(INCLUDES) $(SRCS:.ml=.mli) $(SRCS) > .depend
\r
99 ifeq ("$(strip $(SVNLASTCHANGEDATESTR))", "")
\r
100 ifeq ("$(strip $(wildcard versiondate.ml))", "")
\r
101 @echo "***********************************************"
\r
102 @echo "*** Could not expand the SVN version date *****"
\r
103 @echo "*** using the template file as it is *****"
\r
104 @echo "*** The build date will not be correct *****"
\r
105 @echo "***********************************************"
\r
106 cp -p versiondate.ml.tmpl versiondate.ml
\r
108 @echo "***********************************************"
\r
109 @echo "*** Reusing existing versiondate.ml ******"
\r
110 @echo "***********************************************"
\r
113 sed -e '/let/s/AUTO_UPDATE_DATE/$(SVNLASTCHANGEDATESTR)/' -e '/let/s/AUTO_UPDATE_REV/$(SVNLASTCHANGEREVSTR)/' < versiondate.ml.tmpl > versiondate.ml
\r
117 $(MAKE) versiontarget
\r
119 versiondate.ml: $(filter-out versiondate.ml, $(SRCS))
\r
120 $(MAKE) versiontarget
\r