source: branches/CasADiInterfaceUpdate/Makefile.am @ 13800

Last change on this file since 13800 was 6488, checked in by Jesper Mattsson, 5 years ago

Fixed build script that was broken by r6487. (#3638)

File size: 20.5 KB
Line 
1#
2#    Copyright (C) 2009 Modelon AB
3#
4#    This program is free software: you can redistribute it and/or modify
5#    it under the terms of the Common Public License as published by
6#    IBM, version 1.0 of the License.
7#
8#    This program is distributed in the hope that it will be useful,
9#    but WITHOUT ANY WARRANTY. See the Common Public License for more details.
10#
11#    You should have received a copy of the Common Public License
12#    along with this program.  If not, see
13#     <http://www.ibm.com/developerworks/library/os-cpl.html/>.
14
15
16AUTOMAKE_OPTIONS = foreign
17ACLOCAL_AMFLAGS = -I m4
18
19
20# EXTRA_DIST =
21
22# SUBDIRS = ThirdParty/Sundials ThirdParty/Zlib ThirdParty/Minizip ThirdParty/Expat JMI/src ThirdParty/Blas ThirdParty/Lapack external/FMILibrary
23SUBDIRS = ThirdParty/Sundials ThirdParty/Minpack JMI/src ThirdParty/Blas ThirdParty/Lapack external/FMILibrary RuntimeLibrary Python/src/tests_jmodelica/files/Modelica/Resources
24
25assimulo_install_dir=$(abs_builddir)/Assimulo_install
26pymodelica_install_dir=$(abs_builddir)/pymodelica_install
27pyfmi_install_dir=$(abs_builddir)/PyFMI_install
28pyjmi_install_dir=$(abs_builddir)/PyJMI_install
29
30bindistdir=JModelica.org-$(VERSION)-bin
31
32casadi:
33        cd $(abs_builddir)/ThirdParty/CasADi; \
34        make -f Makefile CMAKE_PYTHON_LIBRARY=$(PYTHON_LIB) CMAKE_PYTHON_INCLUDE_DIR=$(PYTHON_INCLUDE)
35
36install_casadi: casadi
37        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/CasADi/lib
38        cp $(abs_builddir)/casadi_build/lib/*.* $(DESTDIR)$(prefix)/ThirdParty/CasADi/lib
39        mkdir -p $(DESTDIR)$(prefix)/Python/
40        cp -r $(abs_builddir)/casadi_install/casadi $(DESTDIR)$(prefix)/Python/
41        ## temp fix
42        cp $(abs_builddir)/casadi_build/swig/casadi.py $(DESTDIR)$(prefix)/Python/casadi
43
44## Install for CasADiInterface, Variables and targets.
45## MC_interface installs the system with Python.
46## If C++ compilation/tests are wanted there is the target MC_interface_cplusplus
47
48MC_INTERFACE=$(abs_top_srcdir)/ModelicaCasADiInterface
49
50export CASADI_HOME=$(abs_top_srcdir)/ThirdParty/CasADi/CasADi
51MC_SRC=$(abs_top_srcdir)/Compiler/ModelicaCompilerCasADi
52OC_SRC=$(abs_top_srcdir)/Compiler/OptimicaCompilerCasADi
53
54# The modelica casadi interface is built into a build folder
55MC_BUILD=$(abs_builddir)/ModelicaCasADiInterfaceBuild
56# Jars from the modified modelica and optimica compilers are put into the JModelica folder
57MC_COMPILERS_DIR=$(MC_BUILD)/JModelica.org
58MC_LIB=$(DESTDIR)$(prefix)/lib/casadi_interface
59
60CASADI_BUILD_DIR=$(abs_builddir)/casadi_build
61
62
63# The CMake for ModelicaCasADi needs these variables.
64export MODELICA_CASADI_HOME= $(MC_INTERFACE)
65export MC_BUILD
66export IPOPT_HOME
67export CASADI_BUILD_DIR
68 
69casadi_interface: casadi install_casadi $(MC_LIB) modelicacasadi_wrapper $(DESTDIR)$(prefix)/Python/modelicacasadi_transfer/__init__.py $(DESTDIR)$(prefix)/Python/modelicacasadi_wrapper/__init__.py $(DESTDIR)$(prefix)/Python/modelicacasadi_transfer/modelica_casadi_transfer_wrapper.py
70        if [ "$(INSTALL_EXTRA_CASADI)" ]; then exec "$(INSTALL_EXTRA_CASADI)" "$(abs_top_srcdir)" "$(DESTDIR)$(prefix)"; fi
71
72ifcasadi: casadi
73        mkdir -p $(MC_BUILD)/ifcasadi; \
74        cd $(MC_BUILD)/ifcasadi; \
75        case $(build) in \
76        *-cygwin*) \
77        cmake $(MC_SRC)/src/swig -G "MSYS Makefiles" ;; \
78        *-mingw*) \
79        cmake $(MC_SRC)/src/swig -G "MSYS Makefiles" ;; \
80        *) \
81        cmake $(MC_SRC)/src/swig ;; \
82        esac
83        cd $(MC_BUILD)/ifcasadi;  make
84
85$(MC_LIB): $(MC_SRC)/bin/ModelicaCompiler.jar $(OC_SRC)/bin/OptimicaCompiler.jar $(MC_SRC)/bin/util.jar ifcasadi
86        rm -rf $(MC_LIB)
87        mkdir -p $(MC_LIB)
88        cp $(MC_SRC)/bin/ModelicaCompiler.jar $(MC_LIB)
89        cp $(OC_SRC)/bin/OptimicaCompiler.jar $(MC_LIB)
90        cp $(MC_SRC)/bin/util.jar $(MC_LIB)
91        case $(build) in \
92        *-cygwin*) \
93        cp $(MC_BUILD)/ifcasadi/ifcasadi.dll $(MC_LIB) ;; \
94        *-mingw*) \
95        cp $(MC_BUILD)/ifcasadi/ifcasadi.dll $(MC_LIB) ;; \
96        *) \
97        cp $(MC_BUILD)/ifcasadi/libifcasadi.so $(MC_LIB) ;; \
98        esac
99
100mc_modelica: ifcasadi
101        cd $(MC_SRC); $(ANT_OPTS) $(ANT)
102
103mc_optimica: ifcasadi
104        mkdir -p $(OC_SRC)/src/java-generated
105        cp -pr $(MC_SRC)/src/java-generated/casadi $(OC_SRC)/src/java-generated
106        cd $(OC_SRC); $(ANT_OPTS) $(ANT)
107
108$(MC_SRC)/bin/ModelicaCompiler.jar: mc_modelica
109$(MC_SRC)/bin/util.jar:             mc_modelica
110$(MC_SRC)/bin/separateProcess.jar:  mc_modelica
111
112$(OC_SRC)/bin/OptimicaCompiler.jar: mc_optimica
113$(OC_SRC)/bin/util.jar:             mc_optimica
114$(OC_SRC)/bin/separateProcess.jar:  mc_optimica
115
116$(MC_BUILD)/modelicacasadi_wrapper/swig/modelicacasadi_wrapper.py: modelicacasadi_wrapper
117
118# Hook for using a specific Python installation
119PYTHON_LIB=
120PYTHON_INCLUDE=
121
122modelicacasadi_wrapper:
123        if [ "$(PYTHON_LIB)" ] && [ "$(PYTHON_INCLUDE)" ]; then \
124          CMAKE_EXTRA_ARGS="-DPYTHON_LIBRARY=$(PYTHON_LIB) -DPYTHON_INCLUDE_DIR=$(PYTHON_INCLUDE)"; \
125        else \
126          CMAKE_EXTRA_ARGS=""; \
127        fi; \
128        mkdir -p $(MC_BUILD)/modelicacasadi_wrapper; \
129        cd $(MC_BUILD)/modelicacasadi_wrapper; \
130        case $(build) in \
131        *-cygwin*) \
132        cmake $(MC_INTERFACE) -G "MSYS Makefiles" $${CMAKE_EXTRA_ARGS} ;; \
133        *-mingw*) \
134        cmake $(MC_INTERFACE) -G "MSYS Makefiles" $${CMAKE_EXTRA_ARGS} ;; \
135        *) \
136        cmake $(MC_INTERFACE) $${CMAKE_EXTRA_ARGS} ;; \
137        esac
138        cd $(MC_BUILD)/modelicacasadi_wrapper;  make modelicacasadi_wrapper
139
140
141 $(DESTDIR)$(prefix)/Python/modelicacasadi_transfer/__init__.py: install_modelicacasadi_transfer
142 $(DESTDIR)$(prefix)/Python/modelicacasadi_transfer/modelica_casadi_transfer_wrapper.py: install_modelicacasadi_transfer
143 
144 $(DESTDIR)$(prefix)/Python/modelicacasadi_wrapper/__init__.py: install_modelicacasadi_wrapper
145 
146 install_modelicacasadi_wrapper: $(MC_BUILD)/modelicacasadi_wrapper/swig/modelicacasadi_wrapper.py
147        mkdir -p $(DESTDIR)$(prefix)/Python/modelicacasadi_wrapper
148        cp $(MC_BUILD)/modelicacasadi_wrapper/swig/*modelicacasadi_wrapper* $(DESTDIR)$(prefix)/Python/modelicacasadi_wrapper
149        rm -f $(DESTDIR)$(prefix)/Python/modelicacasadi_wrapper/__init__.py
150        touch $(DESTDIR)$(prefix)/Python/modelicacasadi_wrapper/__init__.py
151        echo "from modelicacasadi_wrapper import *" >> $(DESTDIR)$(prefix)/Python/modelicacasadi_wrapper/__init__.py
152 
153 install_modelicacasadi_transfer: $(MC_INTERFACE)/python/modelica_casadi_transfer_wrapper.py
154        mkdir -p $(DESTDIR)$(prefix)/Python/modelicacasadi_transfer
155        rm -f $(DESTDIR)$(prefix)/Python/modelicacasadi_transfer/__init__.py
156        touch $(DESTDIR)$(prefix)/Python/modelicacasadi_transfer/__init__.py
157        echo "from modelica_casadi_transfer_wrapper import *" >> $(DESTDIR)$(prefix)/Python/modelicacasadi_transfer/__init__.py
158        cp $(MC_INTERFACE)/python/modelica_casadi_transfer_wrapper.py $(DESTDIR)$(prefix)/Python/modelicacasadi_transfer
159       
160build-python-packages:
161if WITH_SUNDIALS
162if WITH_SUPERLU
163        cd $(abs_top_srcdir)/external/Assimulo; \
164        python setup.py install --sundials-home=$(SUNDIALS_HOME) --superlu-home=$(SUPERLU_HOME) --blas-home=$(abs_builddir)/ThirdParty/Blas/ --lapack-home=$(abs_builddir)/ThirdParty/Lapack/ --prefix=$(assimulo_install_dir)
165endif
166endif
167if WITH_SUNDIALS
168if !WITH_SUPERLU
169        cd $(abs_top_srcdir)/external/Assimulo; \
170        python setup.py install --sundials-home=$(SUNDIALS_HOME) --blas-home=$(abs_builddir)/ThirdParty/Blas/ --lapack-home=$(abs_builddir)/ThirdParty/Lapack/ --prefix=$(assimulo_install_dir)
171endif
172endif
173        cd $(abs_top_srcdir)/Python/src; \
174        python setup_pymodelica.py install --prefix=$(pymodelica_install_dir); \
175        rm -rf build
176
177        cd $(abs_top_srcdir)/external/PyFMI; \
178        python setup.py install --fmil-home=$(abs_builddir)/FMIL_install/ --prefix=$(pyfmi_install_dir); \
179        rm -rf build
180
181        cd $(abs_top_srcdir)/Python/src; \
182        python setup_pyjmi.py install --prefix=$(pyjmi_install_dir); \
183        rm -rf build
184
185install-python-packages: build-python-packages
186        mkdir -p $(DESTDIR)$(prefix)/Python
187        cp $(abs_top_srcdir)/Python/src/startup.py $(DESTDIR)$(prefix)/
188        [ $(abs_top_srcdir) == $(DESTDIR)$(prefix) ] && echo "Installing in dist directory, don't copy LICENSE file" || cp $(abs_top_srcdir)/Python/LICENSE $(DESTDIR)$(prefix)/Python
189if WITH_SUNDIALS
190        for pkgdir in lib/python2.5 lib/python2.6 lib/python2.7 lib64/python2.5 lib64/python2.6 lib64/python2.7 Lib; do \
191        if [ -e $(assimulo_install_dir)/$${pkgdir}/site-packages/ ]; \
192        then \
193        cd $(assimulo_install_dir)/$${pkgdir}/site-packages/; \
194        find assimulo -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(DESTDIR)$(prefix)/Python; \
195        fi; \
196        done
197endif
198        for pkgdir in lib/python2.5 lib/python2.6 lib/python2.7 lib64/python2.5 lib64/python2.6 lib64/python2.7 Lib; do \
199        if [ -e $(pymodelica_install_dir)/$${pkgdir}/site-packages/ ]; \
200        then \
201        cd $(pymodelica_install_dir)/$${pkgdir}/site-packages/; \
202        find pymodelica -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(DESTDIR)$(prefix)/Python; \
203        fi; \
204        done
205        for pkgdir in lib/python2.5 lib/python2.6 lib/python2.7 lib64/python2.5 lib64/python2.6 lib64/python2.7 Lib; do \
206        if [ -e $(pyjmi_install_dir)/$${pkgdir}/site-packages/ ]; \
207        then \
208        cd $(pyjmi_install_dir)/$${pkgdir}/site-packages/; \
209        find pyjmi -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(DESTDIR)$(prefix)/Python; \
210        fi; \
211        done
212        for pkgdir in lib/python2.5 lib/python2.6 lib/python2.7 lib64/python2.5 lib64/python2.6 lib64/python2.7 Lib; do \
213        if [ -e $(pyfmi_install_dir)/$${pkgdir}/site-packages/ ]; \
214        then \
215        cd $(pyfmi_install_dir)/$${pkgdir}/site-packages/; \
216        find pyfmi -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(DESTDIR)$(prefix)/Python; \
217        fi; \
218        done
219        cd $(abs_top_srcdir)/Python/src/tests_jmodelica/; \
220        mkdir -p $(DESTDIR)$(prefix)/Python/tests_jmodelica; \
221        find . -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(DESTDIR)$(prefix)/Python/tests_jmodelica
222        rm -rf $(DESTDIR)$(prefix)/Python/tests_jmodelica/files/Modelica/Resources/src
223        rm -f $(DESTDIR)$(prefix)/Python/tests_jmodelica/files/Modelica/Resources/CMakeLists.txt
224        rm -f $(DESTDIR)$(prefix)/Python/tests_jmodelica/files/Modelica/Resources/Makefile.am
225        rm -f $(DESTDIR)$(prefix)/Python/tests_jmodelica/files/Modelica/Resources/Makefile.in
226        mkdir -p $(DESTDIR)$(prefix)/bin
227        [ -e $(DESTDIR)$(prefix)/bin/jm_python.sh ] && echo "File exists, don't copy jm_python.sh" || cp Python/jm_python.sh $(DESTDIR)$(prefix)/bin/jm_python.sh
228        [ -e $(DESTDIR)$(prefix)/bin/jm_ipython.sh  ] && echo "File exists, don't jm_ipython.sh" || cp Python/jm_ipython.sh $(DESTDIR)$(prefix)/bin/jm_ipython.sh
229        chmod ugo+x $(DESTDIR)$(prefix)/bin/jm_*.sh
230
231# Hooks for extra build or install actions. Must be empty or the path of a shell script to execute.
232# Both scripts will get the source directory as the first argument and the install directory as the second.
233BUILD_EXTRA=
234INSTALL_EXTRA=
235INSTALL_EXTRA_CASADI=
236
237# Paths for Java build
238JAVA_BUILD_DIR=$(abs_builddir)/java
239COMPILER_DIR=$(abs_top_srcdir)/Compiler
240JAVA_MC_ANT_FILE=$(COMPILER_DIR)/ModelicaCompiler/build.xml
241JAVA_OC_ANT_FILE=$(COMPILER_DIR)/OptimicaCompiler/build.xml
242
243all-local: build-python-packages
244if HAVE_ANT
245        mkdir -p $(JAVA_BUILD_DIR)
246        cd $(JAVA_BUILD_DIR); \
247        $(ANT_OPTS) $(ANT) -f "$(JAVA_MC_ANT_FILE)" "-Dcompiler=$(COMPILER_DIR)"
248        cd $(JAVA_BUILD_DIR); \
249        $(ANT_OPTS) $(ANT) -f "$(JAVA_OC_ANT_FILE)" "-Dcompiler=$(COMPILER_DIR)"
250        java -cp "$(JAVA_BUILD_DIR)/bin/ModelicaCompiler.jar:$(JAVA_BUILD_DIR)/bin/util.jar:$(abs_top_srcdir)/ThirdParty/Beaver/beaver-0.9.6.1/lib/beaver-rt.jar" org.jmodelica.modelica.compiler.ModelicaCompiler\$$OptionExporter "$(abs_builddir)/DefaultOptions.xml"
251endif
252        $(abs_top_srcdir)/get_version.sh $(abs_top_srcdir) https://svn.jmodelica.org > $(abs_builddir)/version.txt
253        if [ "$(BUILD_EXTRA)" ]; then exec "$(BUILD_EXTRA)" "$(abs_top_srcdir)" "$(DESTDIR)$(prefix)"; fi
254
255install-exec-local: install-python-packages
256if HAVE_ANT
257        cp $(JAVA_BUILD_DIR)/bin/ModelicaCompiler.jar $(DESTDIR)$(prefix)/lib/
258        cp $(JAVA_BUILD_DIR)/bin/util.jar $(DESTDIR)$(prefix)/lib/
259        cp $(JAVA_BUILD_DIR)/bin/OptimicaCompiler.jar $(DESTDIR)$(prefix)/lib/
260        cp $(JAVA_BUILD_DIR)/bin/separateProcess.jar $(DESTDIR)$(prefix)/lib/
261endif
262        [ $(abs_top_srcdir) == $(DESTDIR)$(prefix) ] && echo "Installing in dist directory, don't copy LICENSE file" || cp $(abs_top_srcdir)/LICENSE $(DESTDIR)$(prefix)/
263        cp $(abs_top_srcdir)/JMI/LICENSE_GPL $(DESTDIR)$(prefix)/lib/
264        cp $(abs_top_srcdir)/JMI/LICENSE_CPL $(DESTDIR)$(prefix)/lib/
265        cp $(abs_top_srcdir)/JMI/LICENSE_GPL $(DESTDIR)$(prefix)/include/
266        cp $(abs_top_srcdir)/JMI/LICENSE_CPL $(DESTDIR)$(prefix)/include/
267        mkdir -p $(DESTDIR)$(prefix)/Makefiles
268        cp $(abs_top_srcdir)/JMI/LICENSE_GPL $(DESTDIR)$(prefix)/Makefiles/LICENSE
269        case $(build) in \
270        *-cygwin*) \
271        cp $(abs_top_srcdir)/RuntimeLibrary/Makefiles/Makefile.windows $(DESTDIR)$(prefix)/Makefiles/Makefile ;; \
272        *-mingw*) \
273        cp $(abs_top_srcdir)/RuntimeLibrary/Makefiles/Makefile.windows $(DESTDIR)$(prefix)/Makefiles/MakeFile ;; \
274        *-apple*) \
275        cp $(abs_top_srcdir)/RuntimeLibrary/Makefiles/Makefile.macosx $(DESTDIR)$(prefix)/Makefiles/MakeFile ;; \
276        *) \
277        cp $(abs_top_srcdir)/RuntimeLibrary/Makefiles/Makefile.linux $(DESTDIR)$(prefix)/Makefiles/MakeFile ;; \
278        esac
279
280if WITH_MINGW
281        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/pthreads/lib
282        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/pthreads/include
283        cp $(abs_top_srcdir)/ThirdParty/pthreads/lib/win32/libpthreadGC2-2-9-1.a $(DESTDIR)$(prefix)/ThirdParty/pthreads/lib
284        cp $(abs_top_srcdir)/ThirdParty/pthreads/include/*.h $(DESTDIR)$(prefix)/ThirdParty/pthreads/include
285endif
286
287        cp $(abs_builddir)/DefaultOptions.xml $(DESTDIR)$(prefix)/DefaultOptions.xml
288        mkdir -p $(DESTDIR)$(prefix)/ThirdParty
289        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/Beaver
290        cp $(abs_top_srcdir)/ThirdParty/Beaver/beaver-0.9.6.1/LICENSE $(DESTDIR)$(prefix)/ThirdParty/Beaver/
291        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/Beaver/lib
292        cp $(abs_top_srcdir)/ThirdParty/Beaver/beaver-0.9.6.1/lib/beaver-rt.jar $(DESTDIR)$(prefix)/ThirdParty/Beaver/lib/
293        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/Sundials
294        cp -r $(SUNDIALS_HOME)/* $(DESTDIR)$(prefix)/ThirdParty/Sundials
295        cp $(abs_top_srcdir)/ThirdParty/Sundials/sundials-2.5.0/LICENSE $(DESTDIR)$(prefix)/ThirdParty/Sundials
296        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/Minpack
297        cp -r $(MINPACK_HOME)/* $(DESTDIR)$(prefix)/ThirdParty/Minpack
298        cp $(abs_top_srcdir)/ThirdParty/Minpack/cminpack-1.3.2/CopyrightMINPACK.txt $(DESTDIR)$(prefix)/ThirdParty/Minpack
299        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/CppAD
300        cp $(CPPAD_HOME)/COPYING $(DESTDIR)$(prefix)/ThirdParty/CppAD
301        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/CppAD/cppad     
302        cp $(CPPAD_HOME)/cppad/*.h $(DESTDIR)$(prefix)/ThirdParty/CppAD/cppad
303        cp $(CPPAD_HOME)/cppad/*.hpp $(DESTDIR)$(prefix)/ThirdParty/CppAD/cppad
304        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/CppAD/cppad/local       
305        cp $(CPPAD_HOME)/cppad/local/*.hpp $(DESTDIR)$(prefix)/ThirdParty/CppAD/cppad/local
306        if [ $(abs_top_srcdir) == $(DESTDIR)$(prefix) ]; then \
307          echo "Installing in dist directory, don't copy MSL"; \
308        else \
309          mkdir -p "$(DESTDIR)$(prefix)/ThirdParty/MSL/Modelica"; \
310          mkdir -p "$(DESTDIR)$(prefix)/ThirdParty/MSL/ModelicaServices"; \
311          cd "$(DESTDIR)$(prefix)/ThirdParty/MSL"; \
312          find . -depth -print0 | while read -d $$'\0' -r f ; do if [ ! -e "$(abs_top_srcdir)/ThirdParty/MSL/$${f}" ]; then rm -rf "$${f}"; fi; done; \
313          cd "$(abs_top_srcdir)/ThirdParty/MSL/Modelica"; \
314          find * -type f |grep -v /.svn | grep -v ~ |tar c -T - -f - | tar x -C "$(DESTDIR)$(prefix)/ThirdParty/MSL/Modelica"; \
315          cd "$(abs_top_srcdir)/ThirdParty/MSL/ModelicaServices"; \
316          find * -type f |grep -v /.svn | grep -v ~ |tar c -T - -f - | tar x -C "$(DESTDIR)$(prefix)/ThirdParty/MSL/ModelicaServices"; \
317          cd "$(abs_top_srcdir)/ThirdParty/MSL"; \
318          $(CP) Complex.mo "$(DESTDIR)$(prefix)/ThirdParty/MSL"; \
319        fi
320        mkdir -p $(DESTDIR)$(prefix)/CodeGenTemplates
321        cp $(abs_top_srcdir)/JMI/LICENSE_GPL $(DESTDIR)$(prefix)/CodeGenTemplates/LICENSE
322        cp  $(abs_top_srcdir)/Compiler/ModelicaCBackEnd/templates/ceval_external_template.c $(DESTDIR)$(prefix)/CodeGenTemplates
323        cp  $(abs_top_srcdir)/Compiler/ModelicaCBackEnd/templates/jmi_modelica_template.c $(DESTDIR)$(prefix)/CodeGenTemplates
324        cp  $(abs_top_srcdir)/Compiler/ModelicaCBackEnd/templates/fmi1_me_modelica_template.c $(DESTDIR)$(prefix)/CodeGenTemplates
325        cp  $(abs_top_srcdir)/Compiler/ModelicaCBackEnd/templates/fmi1_cs_modelica_template.c $(DESTDIR)$(prefix)/CodeGenTemplates
326        cp  $(abs_top_srcdir)/Compiler/ModelicaCBackEnd/templates/fmi2_master_modelica_template.c $(DESTDIR)$(prefix)/CodeGenTemplates
327        cp  $(abs_top_srcdir)/Compiler/ModelicaCBackEnd/templates/fmi_code_gen_template.c $(DESTDIR)$(prefix)/CodeGenTemplates
328        cp  $(abs_top_srcdir)/Compiler/ModelicaCBackEnd/templates/fmi2_functions_common_template.c $(DESTDIR)$(prefix)/CodeGenTemplates
329        cp  $(abs_top_srcdir)/Compiler/ModelicaCBackEnd/templates/fmi2_functions_me_template.c $(DESTDIR)$(prefix)/CodeGenTemplates
330        cp  $(abs_top_srcdir)/Compiler/ModelicaCBackEnd/templates/fmi2_functions_cs_template.c $(DESTDIR)$(prefix)/CodeGenTemplates
331        cp  $(abs_top_srcdir)/Compiler/OptimicaCBackEnd/templates/jmi_optimica_template.c $(DESTDIR)$(prefix)/CodeGenTemplates
332        cp  $(abs_top_srcdir)/Compiler/ModelicaFMUXBackEnd/templates/*.tpl $(DESTDIR)$(prefix)/CodeGenTemplates
333        mkdir -p $(DESTDIR)$(prefix)/XML
334        [ $(abs_top_srcdir) == $(DESTDIR)$(prefix) ] && echo "Installing in dist directory, don't copy XML schemas"  || cp  $(abs_top_srcdir)/XML/*.xsd $(DESTDIR)$(prefix)/XML
335        [ $(abs_top_srcdir) == $(DESTDIR)$(prefix) ] && echo "Installing in dist directory, don't copy XML LICENSE"  || cp  $(abs_top_srcdir)/XML/LICENSE $(DESTDIR)$(prefix)/XML
336        cp  $(abs_builddir)/version.txt $(DESTDIR)$(prefix)
337        cp jm_tests $(DESTDIR)$(prefix)/jm_tests
338        chmod ugo+x $(DESTDIR)$(prefix)/jm_tests
339        if [ "$(INSTALL_EXTRA)" ]; then exec "$(INSTALL_EXTRA)" "$(abs_top_srcdir)" "$(DESTDIR)$(prefix)"; fi
340
341bindistdir: install
342        rm -rf $(bindistdir)
343        mkdir -p $(bindistdir)
344        cp $(DESTDIR)$(prefix)/LICENSE $(bindistdir)
345        cp $(DESTDIR)$(prefix)/startup.py $(bindistdir)
346        cp $(DESTDIR)$(prefix)/version.txt $(bindistdir)
347        cp $(DESTDIR)$(prefix)/DefaultOptions.xml $(bindistdir)
348        cp -r $(DESTDIR)$(prefix)/CodeGenTemplates $(bindistdir)
349        cp -r $(DESTDIR)$(prefix)/Makefiles $(bindistdir)
350        cp -r $(DESTDIR)$(prefix)/Python $(bindistdir)
351        cp -r $(DESTDIR)$(prefix)/ThirdParty $(bindistdir)
352        cp -r $(DESTDIR)$(prefix)/XML $(bindistdir)
353        cp -r $(DESTDIR)$(prefix)/include $(bindistdir)
354        cp -r $(DESTDIR)$(prefix)/lib $(bindistdir)
355if COMPILE_WITH_IPOPT   
356        mkdir -p $(bindistdir)/ThirdParty/Ipopt
357# Copy files
358        cd $(IPOPT_HOME); find * -type f |grep -v /.svn | grep -v ~ |tar c -T - -f - | tar x -C $(abs_builddir)/$(bindistdir)/ThirdParty/Ipopt
359# Copy symbolic links
360        cd $(IPOPT_HOME); find * -type l |grep -v /.svn | grep -v ~ |tar c -T - -f - | tar x -C $(abs_builddir)/$(bindistdir)/ThirdParty/Ipopt
361endif
362
363if WITH_MINGW   
364        mkdir -p $(bindistdir)/ThirdParty/MinGW
365# Copy files
366        cd $(MINGW_HOME); find * -type f |grep -v /.svn | grep -v ~ |tar c -T - -f - | tar x -C $(abs_builddir)/$(bindistdir)/ThirdParty/MinGW
367# Copy symbolic links
368        cd $(MINGW_HOME); find * -type l |grep -v /.svn | grep -v ~ |tar c -T - -f - | tar x -C $(abs_builddir)/$(bindistdir)/ThirdParty/MinGW
369endif
370
371bindist: bindistdir
372        tar -cf $(bindistdir).tar $(bindistdir)
373        gzip -c $(bindistdir).tar > $(bindistdir).tar.gz
374        rm -rf $(bindistdir)
375        rm -rf $(bindistdir).tar
376
377test: install
378        $(prefix)/jm_tests -i
379
380clean-local: clean-frontends clean-python-packages clean-casadi-interface
381
382clean-casadi-interface:
383        rm -rf $(MC_BUILD)
384#       rm -rf $(DESTDIR)$(prefix)/Python/casadi
385#       rm -rf $(DESTDIR)$(prefix)/Python/modelicacasadi_transfer
386if HAVE_ANT
387        cd $(abs_top_srcdir)/Compiler/ModelicaCompilerCasADi; \
388        $(ANT_OPTS) $(ANT) clean ; rm -rf $(MC_SRC)/src/cpp-generated $(MC_SRC)/src/java-generated/casadi
389        cd $(abs_top_srcdir)/Compiler/OptimicaCompilerCasADi; \
390        $(ANT_OPTS) $(ANT) clean ; rm -rf $(OC_SRC)/src/cpp-generated $(OC_SRC)/src/java-generated/casadi
391endif
392       
393
394clean-python-packages:
395if WITH_SUNDIALS
396        cd $(abs_top_srcdir)/external/Assimulo; \
397        python setup.py clean --all --sundials-home=$(SUNDIALS_HOME)
398        rm -rf $(assimulo_install_dir) || echo  Could not remove $(assimulo_install_dir)
399endif
400        -cd $(abs_top_srcdir)/Python/src; \
401        python setup_pymodelica.py clean --all
402        -rm -rf $(pymodelica_install_dir) || echo  Could not remove $(pymodelica_install_dir)
403        -cd $(abs_top_srcdir)/external/PyFMI; \
404        python setup.py  clean --all
405        -rm -rf $(pyfmi_install_dir) || echo  Could not remove $(pyfmi_install_dir)
406        -cd $(abs_top_srcdir)/Python/src; \
407        python setup_pyjmi.py clean --all
408        -rm -rf $(pyjmi_install_dir)|| echo  Could not remove $(pyjmi_install_dir)
409
410clean-frontends:
411if HAVE_ANT
412        rm -rf $(JAVA_BUILD_DIR)
413endif
414
415docs:
416        cd $(abs_top_srcdir); doxygen doc/JMI/jmi_doxydoc.conf
417        cd $(abs_top_srcdir); doxygen doc/ModelicaCompiler/modelica_compiler_doxydoc.conf
418        cd $(abs_top_srcdir); doxygen doc/OptimicaCompiler/optimica_compiler_doxydoc.conf
419        make -C $(abs_top_srcdir)/doc/PyJMI html
420
421docbook-docs:
422        cd docbook/UsersGuide; $(MAKE) all
423
424
425.PHONY: modelicacasadi_wrapper ifcasadi install_modelicacasadi_transfer install_modelicacasadi_wrapper
Note: See TracBrowser for help on using the repository browser.