source: branches/dev-5671/Makefile.am @ 13800

Last change on this file since 13800 was 11556, checked in by Christian Andersson, 16 months ago

Adding winpthreads from https://sourceforge.net/p/mingw-w64/mingw-w64/ci/master/tree/mingw-w64-libraries/winpthreads to the build system and added so that our FMUs are linked against that library to overcome an issue on Windows 10 using our FMUs together with VS2017 compiled software. Related to ticket:5671

File size: 34.7 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
19SUBDIRS = ThirdParty/winpthreads ThirdParty/SuperLU ThirdParty/Sundials ThirdParty/Minpack ThirdParty/Blas ThirdParty/Lapack ThirdParty/MSL external/FMILibrary RuntimeLibrary Python
20
21assimulo_install_dir=$(abs_builddir)/Assimulo_install
22pymodelica_install_dir=$(abs_builddir)/pymodelica_install
23pyfmi_install_dir=$(abs_builddir)/PyFMI_install
24pyjmi_install_dir=$(abs_builddir)/PyJMI_install
25assimulo_install_dir64=$(abs_builddir)/Assimulo_install64
26pymodelica_install_dir64=$(abs_builddir)/pymodelica_install64
27pyfmi_install_dir64=$(abs_builddir)/PyFMI_install64
28pyjmi_install_dir64=$(abs_builddir)/PyJMI_install64
29
30assimulo_build_dir=$(abs_builddir)/Assimulo_build
31pymodelica_build_dir=$(abs_builddir)/pymodelica_build
32pyfmi_build_dir=$(abs_builddir)/PyFMI_build
33pyjmi_build_dir=$(abs_builddir)/PyJMI_build
34assimulo_build_dir64=$(abs_builddir)/Assimulo_build64
35pymodelica_build_dir64=$(abs_builddir)/pymodelica_build64
36pyfmi_build_dir64=$(abs_builddir)/PyFMI_build64
37pyjmi_build_dir64=$(abs_builddir)/PyJMI_build64
38
39bindistdir=JModelica.org-$(VERSION)-bin
40
41casadi:
42        cd $(abs_builddir)/ThirdParty/CasADi; \
43        make -f Makefile  "SWIGCHECK_BUILD_DIR=$(SWIGCHECK_BUILD_DIR)" "CASADI_BUILD_DIR=$(CASADI_BUILD_DIR)" "IPOPT_HOME=$(IPOPT_HOME)" "CASADI_PYTHON_INST_DIR=${CASADI_PYTHON_INST_DIR}" "CASADI_INST_DIR=${CASADI_INST_DIR}" "CASADI_PLUGIN_INST_DIR=${CASADI_PLUGIN_INST_DIR}" "CMAKE_CASADI_ARGS=${CMAKE_CASADI_ARGS}" "CMAKE_CASADI_COMPILER_ARGS=${CMAKE_CASADI_COMPILER_ARGS}" "CMAKE_CASADI_CXX_FLAG=${CMAKE_CASADI_CXX_FLAG}" "CMAKE_PYTHON_LIB=${CMAKE_PYTHON_LIB}"
44if COMPILE_WITH_IPOPT64
45        export PATH=$(PYTHON64_HOME):$(PYTHON64_HOME)/Scripts:$(PYTHON64_HOME)/Lib:"${PATH}"; \
46        export PYTHONHOME=$(PYTHON64_HOME); \
47        cd $(abs_builddir)/ThirdParty/CasADi; \
48        make -f Makefile  "SWIGCHECK_BUILD_DIR=$(SWIGCHECK_BUILD_DIR64)" "CASADI_BUILD_DIR=$(CASADI_BUILD_DIR64)" "IPOPT_HOME=$(IPOPT64_HOME)" "CASADI_PYTHON_INST_DIR=${CASADI_PYTHON_INST_DIR64}" "CASADI_INST_DIR=${CASADI_INST_DIR64}" "CASADI_PLUGIN_INST_DIR=${CASADI_PLUGIN_INST_DIR64}" "CMAKE_CASADI_ARGS=${CMAKE_CASADI_ARGS64}" "CMAKE_CASADI_COMPILER_ARGS=${CMAKE_CASADI_COMPILER_ARGS64}" "CMAKE_CASADI_CXX_FLAG=${CMAKE_CASADI_CXX_FLAG64}" "CMAKE_PYTHON_LIB=${CMAKE_PYTHON64_LIB}" "CMAKE_PYTHON_INCLUDE=${CMAKE_PYTHON64_INCLUDE}"
49        export PYTHONHOME=$(ORIG_PYTHON_HOME); \
50        export PATH="$(ORIG_PATH)";
51endif
52
53install_casadi: casadi
54        cd $(abs_builddir)/ThirdParty/CasADi; \
55        make -f Makefile install "SWIGCHECK_BUILD_DIR=$(SWIGCHECK_BUILD_DIR)" "CASADI_BUILD_DIR=$(CASADI_BUILD_DIR)" "IPOPT_HOME=$(IPOPT_HOME)"
56        mkdir -p $(DESTDIR)$(prefix)/Python/
57        cp -r $(abs_builddir)/casadi_install/casadi $(DESTDIR)$(prefix)/Python/
58        ## temp fix
59        cp $(abs_builddir)/casadi_build/swig/casadi_core.py $(DESTDIR)$(prefix)/Python/casadi
60if COMPILE_WITH_IPOPT64 
61        export PATH=$(PYTHON64_HOME):$(PYTHON64_HOME)/Scripts:$(PYTHON64_HOME)/Lib:"${PATH}"; \
62        export PYTHONHOME=$(PYTHON64_HOME); 
63        cd $(abs_builddir)/ThirdParty/CasADi; \
64        make -f Makefile install "SWIGCHECK_BUILD_DIR=$(SWIGCHECK_BUILD_DIR)" "CASADI_BUILD_DIR=$(CASADI_BUILD_DIR64)" "IPOPT_HOME=$(IPOPT64_HOME)"
65        mkdir -p $(DESTDIR)$(prefix)/Python/
66        cp -r $(abs_builddir)/casadi_install64/casadi $(DESTDIR)$(prefix)/Python_64/
67        ## temp fix
68        cp $(abs_builddir)/casadi_build64/swig/casadi_core.py $(DESTDIR)$(prefix)/Python_64/casadi
69        export PYTHONHOME=$(ORIG_PYTHON_HOME); \
70        export PATH="$(ORIG_PATH)";
71endif
72## Install for CasADiInterface, Variables and targets.
73## MC_interface installs the system with Python.
74## If C++ compilation/tests are wanted there is the target MC_interface_cplusplus
75
76MC_INTERFACE=$(abs_top_srcdir)/ModelicaCasADiInterface
77
78CASADI_HOME=$(abs_top_srcdir)/ThirdParty/CasADi/CasADi
79MC_SRC=$(JAVA_CASADI_BASE_DIR)/ModelicaCompilerCasADi
80OC_SRC=$(JAVA_CASADI_BASE_DIR)/OptimicaCompilerCasADi
81MC_SRC_SWIG=$(abs_top_srcdir)/Compiler/ModelicaCompilerCasADi/src/swig
82
83MC_CASADI_BUILD=$(abs_builddir)/ModelicaCompilerCasADi
84OC_CASADI_BUILD=$(abs_builddir)/OptimicaCompilerCasADi
85
86# The modelica casadi interface is built into a build folder
87MC_BUILD=$(abs_builddir)/ModelicaCasADiInterfaceBuild
88MC_BUILD64=$(abs_builddir)/ModelicaCasADiInterfaceBuild64
89# Jars from the modified modelica and optimica compilers are put into the JModelica folder
90MC_COMPILERS_DIR=$(MC_BUILD)/JModelica.org
91MC_LIB=$(DESTDIR)$(prefix)/lib/casadi_interface
92MC_LIB64=$(DESTDIR)$(prefix)/lib/casadi_interface64
93
94CASADI_BUILD_DIR=$(abs_builddir)/casadi_build
95CASADI_BUILD_DIR64=$(abs_builddir)/casadi_build64
96SWIGCHECK_BUILD_DIR=$(abs_builddir)/swig_check
97SWIGCHECK_BUILD_DIR64=$(abs_builddir)/swig_check64
98CASADI_PYTHON_INST_DIR=$(abs_builddir)/casadi_install
99CASADI_INST_DIR=$(prefix)/ThirdParty/CasADi
100CASADI_PLUGIN_INST_DIR=$(CASADI_INST_DIR)/lib
101CASADI_PYTHON_INST_DIR64=$(abs_builddir)/casadi_install64
102CASADI_INST_DIR64=$(prefix)/ThirdParty/CasADi64
103CASADI_PLUGIN_INST_DIR64=$(CASADI_INST_DIR64)/lib
104CMAKE_CASADI_CXX_FLAG=-m32
105CMAKE_CASADI_COMPILER_ARGS=-m32 -mincoming-stack-boundary=2
106CMAKE_CASADI_CXX_FLAG64=-m64
107CMAKE_CASADI_COMPILER_ARGS64=-m64 -fpermissive
108
109casadi_interface: install_casadi_interface
110build_casadi_interface: casadi modelicacasadi_wrapper
111install_casadi_interface: install_casadi $(MC_LIB) $(DESTDIR)$(prefix)/Python/modelicacasadi_transfer/__init__.py $(DESTDIR)$(prefix)/Python/modelicacasadi_wrapper/__init__.py $(DESTDIR)$(prefix)/Python/modelicacasadi_transfer/modelica_casadi_transfer_wrapper.py
112        if [ "$(INSTALL_EXTRA_CASADI)" ]; then exec "$(INSTALL_EXTRA_CASADI)" "$(abs_top_srcdir)" "$(DESTDIR)$(prefix)"; fi
113
114ifcasadi: casadi
115        mkdir -p $(MC_BUILD)/ifcasadi; \
116        cd $(MC_BUILD)/ifcasadi; \
117        case $(build) in \
118        *-cygwin*|*-mingw*) \
119        cmake $(MC_SRC_SWIG) -G "MSYS Makefiles" -DCMAKE_CXX_COMPILER_ARG1="-m32" -DCMAKE_CXX_FLAGS="-m32" \
120            -DIFCASADI_OUTDIR="$(MC_CASADI_BUILD)" -DCASADI_HOME="$(CASADI_HOME)" -DCASADI_BUILD_DIR="$(CASADI_BUILD_DIR)";; \
121        *) \
122        cmake $(MC_SRC_SWIG) \
123            -DIFCASADI_OUTDIR="$(MC_CASADI_BUILD)" -DCASADI_HOME="$(CASADI_HOME)" -DCASADI_BUILD_DIR="$(CASADI_BUILD_DIR)";; \
124        esac
125        cd $(MC_BUILD)/ifcasadi;  make
126if COMPILE_WITH_IPOPT64
127        export PATH=$(PYTHON64_HOME):$(PYTHON64_HOME)/Scripts:$(PYTHON64_HOME)/Lib:"${PATH}";
128        export PYTHONHOME=$(PYTHON64_HOME);
129        mkdir -p $(MC_BUILD64)/ifcasadi; \
130        cd $(MC_BUILD64)/ifcasadi; \
131        cmake $(MC_SRC_SWIG) -G "MSYS Makefiles" -DCMAKE_CXX_COMPILER_ARG1="-m64" -DCMAKE_CXX_FLAGS="-m64" \
132            -DIFCASADI_OUTDIR="$(MC_CASADI_BUILD)" -DCASADI_HOME="$(CASADI_HOME)" -DCASADI_BUILD_DIR="$(CASADI_BUILD_DIR64)"; \
133        cd $(MC_BUILD64)/ifcasadi;  make
134        export PYTHONHOME=$(ORIG_PYTHON_HOME); \
135        export PATH="$(ORIG_PATH)";
136endif
137
138$(MC_LIB): $(MC_CASADI_BUILD)/bin/ModelicaCompiler.jar $(OC_CASADI_BUILD)/bin/OptimicaCompiler.jar $(MC_CASADI_BUILD)/bin/util.jar ifcasadi
139        rm -rf $(MC_LIB)
140        mkdir -p $(MC_LIB)
141        cp $(MC_CASADI_BUILD)/bin/ModelicaCompiler.jar $(MC_LIB)
142        cp $(OC_CASADI_BUILD)/bin/OptimicaCompiler.jar $(MC_LIB)
143        cp $(MC_CASADI_BUILD)/bin/util.jar $(MC_LIB)
144        case $(build) in \
145        *-cygwin*) \
146        cp $(MC_BUILD)/ifcasadi/ifcasadi.dll $(MC_LIB) ;; \
147        *-mingw*) \
148        cp $(MC_BUILD)/ifcasadi/ifcasadi.dll $(MC_LIB) ;; \
149        *) \
150        cp $(MC_BUILD)/ifcasadi/libifcasadi.so $(MC_LIB) ;; \
151        esac
152if COMPILE_WITH_IPOPT64
153        rm -rf $(MC_LIB64)
154        mkdir -p $(MC_LIB64)
155        cp $(MC_CASADI_BUILD)/bin/ModelicaCompiler.jar $(MC_LIB64)
156        cp $(OC_CASADI_BUILD)/bin/OptimicaCompiler.jar $(MC_LIB64)
157        cp $(MC_CASADI_BUILD)/bin/util.jar $(MC_LIB64)
158        cp $(MC_BUILD64)/ifcasadi/ifcasadi.dll $(MC_LIB64)
159endif
160
161mc_modelica: ifcasadi
162        cd $(MC_CASADI_BUILD); $(ANT_OPTS) $(ANT) -f "$(JAVA_MC_CASADI_ANT_FILE)" "-Dcompiler=$(COMPILER_DIR)"
163
164mc_optimica: ifcasadi
165        mkdir -p $(OC_CASADI_BUILD)/src/java-generated
166        cp -pr $(MC_CASADI_BUILD)/src/java-generated/ifcasadi $(OC_CASADI_BUILD)/src/java-generated
167        cd $(OC_CASADI_BUILD); $(ANT_OPTS) $(ANT) -f "$(JAVA_OC_CASADI_ANT_FILE)" "-Dcompiler=$(COMPILER_DIR)"
168
169$(MC_CASADI_BUILD)/bin/ModelicaCompiler.jar: mc_modelica
170$(MC_CASADI_BUILD)/bin/util.jar:             mc_modelica
171$(MC_CASADI_BUILD)/bin/separateProcess.jar:  mc_modelica
172
173$(OC_CASADI_BUILD)/bin/OptimicaCompiler.jar: mc_optimica
174$(OC_CASADI_BUILD)/bin/util.jar:             mc_optimica
175$(OC_CASADI_BUILD)/bin/separateProcess.jar:  mc_optimica
176
177$(MC_BUILD)/modelicacasadi_wrapper/swig/modelicacasadi_wrapper.py: modelicacasadi_wrapper
178
179
180modelicacasadi_wrapper: $(MC_CASADI_BUILD)/bin/ModelicaCompiler.jar $(OC_CASADI_BUILD)/bin/OptimicaCompiler.jar $(MC_CASADI_BUILD)/bin/util.jar ifcasadi # $(MC_LIB)
181        mkdir -p $(MC_BUILD)/modelicacasadi_wrapper; \
182        cd $(MC_BUILD)/modelicacasadi_wrapper; \
183        case $(build) in \
184        *-cygwin*|*-mingw*) \
185        cmake $(MC_INTERFACE) -G "MSYS Makefiles" -DCMAKE_CXX_COMPILER_ARG1="-m32" -DCMAKE_CXX_FLAGS="-m32" \
186            -DMC_BUILD="$(MC_BUILD)" -DIPOPT_HOME="$(IPOPT_HOME)" -DCASADI_BUILD_DIR="$(CASADI_BUILD_DIR)" \
187            -DIFCASADI_JAR_BASE="$(JAVA_CASADI_BUILD_DIR)" -DCASADI_HOME="$(CASADI_HOME)" \
188            "$(CMAKE_PYTHON_LIB)" "$(CMAKE_PYTHON_INCLUDE)" ;; \
189        *) \
190        cmake $(MC_INTERFACE) \
191            -DMC_BUILD="$(MC_BUILD)" -DIPOPT_HOME="$(IPOPT_HOME)" -DCASADI_BUILD_DIR="$(CASADI_BUILD_DIR)" \
192            -DIFCASADI_JAR_BASE="$(JAVA_CASADI_BUILD_DIR)" -DCASADI_HOME="$(CASADI_HOME)" \
193            "$(CMAKE_PYTHON_LIB)" "$(CMAKE_PYTHON_INCLUDE)" ;; \
194        esac
195        cd $(MC_BUILD)/modelicacasadi_wrapper;  make modelicacasadi_wrapper
196if COMPILE_WITH_IPOPT64
197        export PATH=$(PYTHON64_HOME):$(PYTHON64_HOME)/Scripts:$(PYTHON64_HOME)/Lib:"${PATH}"; \
198        export PYTHONHOME=$(PYTHON64_HOME); \
199        mkdir -p $(MC_BUILD64)/modelicacasadi_wrapper; \
200        cd $(MC_BUILD64)/modelicacasadi_wrapper; \
201        cmake $(MC_INTERFACE) -G "MSYS Makefiles" -DCMAKE_CXX_COMPILER_ARG1="-m64" -DCMAKE_CXX_FLAGS="-m64" \
202            -DMC_BUILD="$(MC_BUILD64)" -DIPOPT_HOME="$(IPOPT64_HOME)" -DCASADI_BUILD_DIR="$(CASADI_BUILD_DIR64)" \
203            -DIFCASADI_JAR_BASE="$(JAVA_CASADI_BUILD_DIR)" -DCASADI_HOME="$(CASADI_HOME)" \
204            "$(CMAKE_PYTHON64_LIB)" "$(CMAKE_PYTHON64_INCLUDE)"; \
205        cd $(MC_BUILD64)/modelicacasadi_wrapper;  make modelicacasadi_wrapper
206        export PYTHONHOME=$(ORIG_PYTHON_HOME);
207        export PATH="$(ORIG_PATH)";
208endif
209
210 $(DESTDIR)$(prefix)/Python/modelicacasadi_transfer/__init__.py: install_modelicacasadi_transfer
211 $(DESTDIR)$(prefix)/Python/modelicacasadi_transfer/modelica_casadi_transfer_wrapper.py: install_modelicacasadi_transfer
212 
213 $(DESTDIR)$(prefix)/Python/modelicacasadi_wrapper/__init__.py: install_modelicacasadi_wrapper
214 
215 install_modelicacasadi_wrapper: $(MC_BUILD)/modelicacasadi_wrapper/swig/modelicacasadi_wrapper.py
216        mkdir -p $(DESTDIR)$(prefix)/Python/modelicacasadi_wrapper
217        cp $(MC_BUILD)/modelicacasadi_wrapper/swig/*modelicacasadi_wrapper* $(DESTDIR)$(prefix)/Python/modelicacasadi_wrapper
218        rm -f $(DESTDIR)$(prefix)/Python/modelicacasadi_wrapper/__init__.py
219        touch $(DESTDIR)$(prefix)/Python/modelicacasadi_wrapper/__init__.py
220        echo "from modelicacasadi_wrapper import *" >> $(DESTDIR)$(prefix)/Python/modelicacasadi_wrapper/__init__.py
221if COMPILE_WITH_IPOPT64
222        export PATH=$(PYTHON64_HOME):$(PYTHON64_HOME)/Scripts:$(PYTHON64_HOME)/Lib:"${PATH}"; \
223        export PYTHONHOME=$(PYTHON64_HOME);
224        mkdir -p $(DESTDIR)$(prefix)/Python_64/modelicacasadi_wrapper
225        cp $(MC_BUILD64)/modelicacasadi_wrapper/swig/*modelicacasadi_wrapper* $(DESTDIR)$(prefix)/Python_64/modelicacasadi_wrapper
226        rm -f $(DESTDIR)$(prefix)/Python_64/modelicacasadi_wrapper/__init__.py
227        touch $(DESTDIR)$(prefix)/Python_64/modelicacasadi_wrapper/__init__.py
228        echo "from modelicacasadi_wrapper import *" >> $(DESTDIR)$(prefix)/Python_64/modelicacasadi_wrapper/__init__.py
229        export PYTHONHOME=$(ORIG_PYTHON_HOME)
230        export PATH="$(ORIG_PATH)"
231endif
232
233 install_modelicacasadi_transfer: $(MC_INTERFACE)/python/modelica_casadi_transfer_wrapper.py
234        mkdir -p $(DESTDIR)$(prefix)/Python/modelicacasadi_transfer
235        rm -f $(DESTDIR)$(prefix)/Python/modelicacasadi_transfer/__init__.py
236        touch $(DESTDIR)$(prefix)/Python/modelicacasadi_transfer/__init__.py
237        echo "from modelica_casadi_transfer_wrapper import *" >> $(DESTDIR)$(prefix)/Python/modelicacasadi_transfer/__init__.py
238        cp $(MC_INTERFACE)/python/modelica_casadi_transfer_wrapper.py $(DESTDIR)$(prefix)/Python/modelicacasadi_transfer
239if COMPILE_WITH_IPOPT64   
240        mkdir -p $(DESTDIR)$(prefix)/Python_64/modelicacasadi_transfer
241        rm -f $(DESTDIR)$(prefix)/Python_64/modelicacasadi_transfer/__init__.py
242        touch $(DESTDIR)$(prefix)/Python_64/modelicacasadi_transfer/__init__.py
243        echo "from modelica_casadi_transfer_wrapper import *" >> $(DESTDIR)$(prefix)/Python_64/modelicacasadi_transfer/__init__.py
244        cp $(MC_INTERFACE)/python/modelica_casadi_transfer_wrapper.py $(DESTDIR)$(prefix)/Python_64/modelicacasadi_transfer
245endif
246       
247if NUMPY_NO_MSVCR
248NUMPY_NO_MSVCR_ARG=--no-msvcr="true"
249else
250NUMPY_NO_MSVCR_ARG=
251endif
252
253build-python-packages:
254
255if WITH_SUNDIALS
256if WITH_OPENMP
257        mkdir -p $(assimulo_build_dir); \
258        cd $(abs_top_srcdir)/external; \
259        find Assimulo -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(assimulo_build_dir); \
260        cd $(assimulo_build_dir)/Assimulo; \
261        case $(build) in \
262        *-cygwin*) \
263        python setup.py install --with_openmp=True --superlu-home=$(abs_builddir)/superlu_build/ --sundials-home=$(SUNDIALS_HOME) --sundials-with-superlu=True --blas-home=$(abs_builddir)/blas_install/ --lapack-home=$(abs_builddir)/lapack_install/ --force-32bit="true" --extra-c-flags="-mincoming-stack-boundary=2" --prefix=$(assimulo_install_dir) ;; \
264        *-mingw*) \
265        python setup.py install --with_openmp=True --superlu-home=$(abs_builddir)/superlu_build/ --sundials-home=$(SUNDIALS_HOME) --sundials-with-superlu=True --blas-home=$(abs_builddir)/blas_install/ --lapack-home=$(abs_builddir)/lapack_install/ --force-32bit="true" $(NUMPY_NO_MSVCR_ARG) --extra-c-flags="-mincoming-stack-boundary=2" --prefix=$(assimulo_install_dir) ;; \
266        *) \
267        python setup.py install --with_openmp=True --superlu-home=$(abs_builddir)/superlu_build/ --sundials-home=$(SUNDIALS_HOME) --sundials-with-superlu=True --blas-home=$(abs_builddir)/blas_install/ --lapack-home=$(abs_builddir)/lapack_install/ --prefix=$(assimulo_install_dir) ;; \
268        esac
269if JM_WIN64
270if WITH_PYTHON64
271        mkdir -p $(assimulo_build_dir64); \
272        cd $(abs_top_srcdir)/external; \
273        find Assimulo -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(assimulo_build_dir64); \
274        cd $(assimulo_build_dir)/Assimulo; \
275        export PATH=$(PYTHON64_HOME):$(PYTHON64_HOME)/Scripts:$(PYTHON64_HOME)/Lib:"${PATH}"; \
276        export PYTHONHOME=$(PYTHON64_HOME); \
277        python setup.py install --with_openmp=True --superlu-home=$(abs_builddir)/superlu_build64/ --sundials-home=$(SUNDIALS_HOME)64 --sundials-with-superlu=True --blas-home=$(abs_builddir)/blas_install64/ --lapack-home=$(abs_builddir)/lapack_install64/ --force-32bit="false" $(NUMPY_NO_MSVCR_ARG) --prefix=$(assimulo_install_dir64); \
278        export PATH="$(ORIG_PATH)"; \
279        export PYTHONHOME=$(ORIG_PYTHON_HOME)
280endif
281endif
282endif
283endif
284if WITH_SUNDIALS
285if !WITH_OPENMP
286        mkdir -p $(assimulo_build_dir); \
287        cd $(abs_top_srcdir)/external; \
288        find Assimulo -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(assimulo_build_dir); \
289        cd $(assimulo_build_dir)/Assimulo; \
290        case $(build) in \
291        *-cygwin*) \
292        python setup.py install --sundials-home=$(SUNDIALS_HOME) --blas-home=$(abs_builddir)/blas_install/ --lapack-home=$(abs_builddir)/lapack_install/ --force-32bit="true" --extra-c-flags="-mincoming-stack-boundary=2" --prefix=$(assimulo_install_dir) ;; \
293        *-mingw*) \
294        python setup.py install --sundials-home=$(SUNDIALS_HOME) --blas-home=$(abs_builddir)/blas_install/ --lapack-home=$(abs_builddir)/lapack_install/ --force-32bit="true" $(NUMPY_NO_MSVCR_ARG) --extra-c-flags="-mincoming-stack-boundary=2" --prefix=$(assimulo_install_dir) ;; \
295        *) \
296        python setup.py install --sundials-home=$(SUNDIALS_HOME) --blas-home=$(abs_builddir)/blas_install/ --lapack-home=$(abs_builddir)/lapack_install/ --prefix=$(assimulo_install_dir) ;; \
297        esac
298if JM_WIN64
299if WITH_PYTHON64
300        mkdir -p $(assimulo_build_dir64); \
301        cd $(abs_top_srcdir)/external; \
302        find Assimulo -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(assimulo_build_dir64); \
303        cd $(assimulo_build_dir64)/Assimulo; \
304        export PATH=$(PYTHON64_HOME):$(PYTHON64_HOME)/Scripts:$(PYTHON64_HOME)/Lib:"${PATH}"; \
305        export PYTHONHOME=$(PYTHON64_HOME); \
306        python setup.py install --sundials-home=$(SUNDIALS_HOME)64 --blas-home=$(abs_builddir)/blas_install64/ --lapack-home=$(abs_builddir)/lapack_install64/ --force-32bit="false" $(NUMPY_NO_MSVCR_ARG) --prefix=$(assimulo_install_dir64) ; \
307        export PATH="$(ORIG_PATH)"; \
308        export PYTHONHOME=$(ORIG_PYTHON_HOME)
309endif
310endif
311endif
312endif
313        cd $(abs_top_srcdir)/Python/src; \
314        python setup_pymodelica.py install --prefix=$(pymodelica_install_dir); \
315        rm -rf build
316if JM_WIN64
317if WITH_PYTHON64
318        cd $(abs_top_srcdir)/Python/src; \
319        export PATH=$(PYTHON64_HOME):$(PYTHON64_HOME)/Scripts:$(PYTHON64_HOME)/Lib:"${PATH}"; \
320        export PYTHONHOME=$(PYTHON64_HOME); \
321        python setup_pymodelica.py install --prefix=$(pymodelica_install_dir64); \
322        export PATH="$(ORIG_PATH)"; \
323        export PYTHONHOME=$(ORIG_PYTHON_HOME); \
324        rm -rf build
325endif
326endif
327        mkdir -p $(pyfmi_build_dir); \
328        cd $(abs_top_srcdir)/external; \
329        find PyFMI -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(pyfmi_build_dir); \
330        cd $(pyfmi_build_dir)/PyFMI; \
331        case $(build) in \
332        *-cygwin*) \
333        python setup.py install --fmil-home=$(abs_builddir)/FMIL_install/ --force-32bit="true" --extra-c-flags="-mincoming-stack-boundary=2" --prefix=$(pyfmi_install_dir) ;; \
334        *-mingw*) \
335        python setup.py install --fmil-home=$(abs_builddir)/FMIL_install/ --force-32bit="true" $(NUMPY_NO_MSVCR_ARG) --extra-c-flags="-mincoming-stack-boundary=2" --prefix=$(pyfmi_install_dir) ;; \
336        *) \
337        python setup.py install --fmil-home=$(abs_builddir)/FMIL_install/ --prefix=$(pyfmi_install_dir) ;; \
338        esac
339        rm -rf build
340if JM_WIN64
341if WITH_PYTHON64
342        mkdir -p $(pyfmi_build_dir64); \
343        cd $(abs_top_srcdir)/external; \
344        find PyFMI -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(pyfmi_build_dir64); \
345        cd $(pyfmi_build_dir64)/PyFMI; \
346        export PATH=$(PYTHON64_HOME):$(PYTHON64_HOME)/Scripts:$(PYTHON64_HOME)/Lib:"${PATH}"; \
347        export PYTHONHOME=$(PYTHON64_HOME); \
348        python setup.py install --fmil-home=$(abs_builddir)/FMIL_install64/ $(NUMPY_NO_MSVCR_ARG) --prefix=$(pyfmi_install_dir64); \
349        export PATH="$(ORIG_PATH)"; \
350        export PYTHONHOME=$(ORIG_PYTHON_HOME); \
351        rm -rf build
352endif
353endif
354        cd $(abs_top_srcdir)/Python/src; \
355        python setup_pyjmi.py install --prefix=$(pyjmi_install_dir); \
356        rm -rf build
357if JM_WIN64
358if WITH_PYTHON64
359        cd $(abs_top_srcdir)/Python/src; \
360        export PATH=$(PYTHON64_HOME):$(PYTHON64_HOME)/Scripts:$(PYTHON64_HOME)/Lib:"${PATH}"; \
361        export PYTHONHOME=$(PYTHON64_HOME); \
362        python setup_pyjmi.py install --prefix=$(pyjmi_install_dir64); \
363        export PATH="$(ORIG_PATH)"; \
364        export PYTHONHOME=$(ORIG_PYTHON_HOME); \
365        rm -rf build
366endif
367endif
368install-python-packages: build-python-packages
369        mkdir -p $(DESTDIR)$(prefix)/Python
370        cp $(abs_top_srcdir)/Python/src/startup.py $(DESTDIR)$(prefix)/
371        cp Python/src/required_defaults.py $(DESTDIR)$(prefix)/Python/
372        [ $(abs_top_srcdir) == $(DESTDIR)$(prefix) ] && echo "Installing in dist directory, don't copy LICENSE file" || cp $(abs_top_srcdir)/Python/LICENSE $(DESTDIR)$(prefix)/Python
373if JM_WIN64
374if WITH_PYTHON64
375        mkdir -p $(DESTDIR)$(prefix)/Python_64
376        cp Python/src/required_defaults.py $(DESTDIR)$(prefix)/Python_64/
377        [ $(abs_top_srcdir) == $(DESTDIR)$(prefix) ] && echo "Installing in dist directory, don't copy LICENSE file" || cp $(abs_top_srcdir)/Python/LICENSE $(DESTDIR)$(prefix)/Python_64
378endif
379endif
380if WITH_SUNDIALS
381        for pkgdir in lib/python2.5 lib/python2.6 lib/python2.7 lib64/python2.5 lib64/python2.6 lib64/python2.7 Lib; do \
382        if [ -e $(assimulo_install_dir)/$${pkgdir}/site-packages/ ]; \
383        then \
384        cd $(assimulo_install_dir)/$${pkgdir}/site-packages/; \
385        find assimulo -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(DESTDIR)$(prefix)/Python; \
386        fi; \
387        done
388endif
389        for pkgdir in lib/python2.5 lib/python2.6 lib/python2.7 lib64/python2.5 lib64/python2.6 lib64/python2.7 Lib; do \
390        if [ -e $(pymodelica_install_dir)/$${pkgdir}/site-packages/ ]; \
391        then \
392        cd $(pymodelica_install_dir)/$${pkgdir}/site-packages/; \
393        find pymodelica -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(DESTDIR)$(prefix)/Python; \
394        fi; \
395        done
396        for pkgdir in lib/python2.5 lib/python2.6 lib/python2.7 lib64/python2.5 lib64/python2.6 lib64/python2.7 Lib; do \
397        if [ -e $(pyjmi_install_dir)/$${pkgdir}/site-packages/ ]; \
398        then \
399        cd $(pyjmi_install_dir)/$${pkgdir}/site-packages/; \
400        find pyjmi -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(DESTDIR)$(prefix)/Python; \
401        fi; \
402        done
403        for pkgdir in lib/python2.5 lib/python2.6 lib/python2.7 lib64/python2.5 lib64/python2.6 lib64/python2.7 Lib; do \
404        if [ -e $(pyfmi_install_dir)/$${pkgdir}/site-packages/ ]; \
405        then \
406        cd $(pyfmi_install_dir)/$${pkgdir}/site-packages/; \
407        find pyfmi -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(DESTDIR)$(prefix)/Python; \
408        fi; \
409        done
410        cd $(abs_top_srcdir)/Python/src/tests_jmodelica/; \
411        mkdir -p $(DESTDIR)$(prefix)/Python/tests_jmodelica; \
412        find . -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(DESTDIR)$(prefix)/Python/tests_jmodelica
413if JM_WIN64
414if WITH_SUNDIALS
415        for pkgdir in lib/python2.5 lib/python2.6 lib/python2.7 lib64/python2.5 lib64/python2.6 lib64/python2.7 Lib; do \
416        if [ -e $(assimulo_install_dir64)/$${pkgdir}/site-packages/ ]; \
417        then \
418        cd $(assimulo_install_dir64)/$${pkgdir}/site-packages/; \
419        find assimulo -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(DESTDIR)$(prefix)/Python_64; \
420        fi; \
421        done
422endif
423        for pkgdir in lib/python2.5 lib/python2.6 lib/python2.7 lib64/python2.5 lib64/python2.6 lib64/python2.7 Lib; do \
424        if [ -e $(pymodelica_install_dir64)/$${pkgdir}/site-packages/ ]; \
425        then \
426        cd $(pymodelica_install_dir64)/$${pkgdir}/site-packages/; \
427        find pymodelica -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(DESTDIR)$(prefix)/Python_64; \
428        fi; \
429        done
430        for pkgdir in lib/python2.5 lib/python2.6 lib/python2.7 lib64/python2.5 lib64/python2.6 lib64/python2.7 Lib; do \
431        if [ -e $(pyjmi_install_dir64)/$${pkgdir}/site-packages/ ]; \
432        then \
433        cd $(pyjmi_install_dir64)/$${pkgdir}/site-packages/; \
434        find pyjmi -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(DESTDIR)$(prefix)/Python_64; \
435        fi; \
436        done
437        for pkgdir in lib/python2.5 lib/python2.6 lib/python2.7 lib64/python2.5 lib64/python2.6 lib64/python2.7 Lib; do \
438        if [ -e $(pyfmi_install_dir64)/$${pkgdir}/site-packages/ ]; \
439        then \
440        cd $(pyfmi_install_dir64)/$${pkgdir}/site-packages/; \
441        find pyfmi -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(DESTDIR)$(prefix)/Python_64; \
442        fi; \
443        done
444if WITH_PYTHON64
445        cd $(abs_top_srcdir)/Python/src/tests_jmodelica/; \
446        mkdir -p $(DESTDIR)$(prefix)/Python_64/tests_jmodelica; \
447        find . -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(DESTDIR)$(prefix)/Python_64/tests_jmodelica
448        rm -rf $(DESTDIR)$(prefix)/Python_64/tests_jmodelica/files/Modelica/Resources/src
449        rm -f $(DESTDIR)$(prefix)/Python_64/tests_jmodelica/files/Modelica/Resources/CMakeLists.txt
450        rm -f $(DESTDIR)$(prefix)/Python_64/tests_jmodelica/files/Modelica/Resources/Makefile.am
451        rm -f $(DESTDIR)$(prefix)/Python_64/tests_jmodelica/files/Modelica/Resources/Makefile.in
452endif
453endif
454        rm -rf $(DESTDIR)$(prefix)/Python/tests_jmodelica/files/Modelica/Resources/src
455        rm -f $(DESTDIR)$(prefix)/Python/tests_jmodelica/files/Modelica/Resources/CMakeLists.txt
456        rm -f $(DESTDIR)$(prefix)/Python/tests_jmodelica/files/Modelica/Resources/Makefile.am
457        rm -f $(DESTDIR)$(prefix)/Python/tests_jmodelica/files/Modelica/Resources/Makefile.in
458        mkdir -p $(DESTDIR)$(prefix)/bin
459        [ -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
460        [ -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
461        chmod ugo+x $(DESTDIR)$(prefix)/bin/jm_*.sh
462
463# Hooks for extra build or install actions. Must be empty or the path of a shell script to execute.
464# Both scripts will get the source directory as the first argument and the install directory as the second.
465BUILD_EXTRA=
466INSTALL_EXTRA=
467INSTALL_EXTRA_CASADI=
468
469# Paths for Java build
470JAVA_BUILD_DIR=$(abs_builddir)/java
471COMPILER_DIR=$(abs_top_srcdir)/Compiler
472JAVA_MC_ANT_FILE=$(COMPILER_DIR)/ModelicaCompiler/build.xml
473JAVA_OC_ANT_FILE=$(COMPILER_DIR)/OptimicaCompiler/build.xml
474JAVA_CASADI_BASE_DIR=$(COMPILER_DIR)
475JAVA_CASADI_BUILD_DIR=$(abs_builddir)
476JAVA_MC_CASADI_ANT_FILE=$(COMPILER_DIR)/ModelicaCompilerCasADi/build.xml
477JAVA_OC_CASADI_ANT_FILE=$(COMPILER_DIR)/OptimicaCompilerCasADi/build.xml
478JAVA_EXEC_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
479
480all-local: build-python-packages build-compiler
481        $(abs_top_srcdir)/get_version.sh $(abs_top_srcdir) https://svn.jmodelica.org > $(abs_builddir)/version.txt
482        if [ "$(BUILD_EXTRA)" ]; then exec "$(BUILD_EXTRA)" "$(abs_top_srcdir)" "$(DESTDIR)$(prefix)"; fi
483
484build-compiler:
485if HAVE_ANT
486        mkdir -p $(JAVA_BUILD_DIR)
487        cd $(JAVA_BUILD_DIR); \
488        $(ANT_OPTS) $(ANT) -f "$(JAVA_MC_ANT_FILE)" "-Dcompiler=$(COMPILER_DIR)"
489        cd $(JAVA_BUILD_DIR); \
490        $(ANT_OPTS) $(ANT) -f "$(JAVA_OC_ANT_FILE)" "-Dcompiler=$(COMPILER_DIR)"
491        java -cp "$(JAVA_EXEC_CP)" org.jmodelica.modelica.compiler.ModelicaCompiler\$$OptionExporter -x "$(abs_builddir)/DefaultOptions.xml"
492endif
493
494install-exec-local: install-python-packages
495if HAVE_ANT
496        cp $(JAVA_BUILD_DIR)/bin/ModelicaCompiler.jar $(DESTDIR)$(prefix)/lib/
497        cp $(JAVA_BUILD_DIR)/bin/util.jar $(DESTDIR)$(prefix)/lib/
498        cp $(JAVA_BUILD_DIR)/bin/OptimicaCompiler.jar $(DESTDIR)$(prefix)/lib/
499        cp $(JAVA_BUILD_DIR)/bin/separateProcess.jar $(DESTDIR)$(prefix)/lib/
500endif
501        [ $(abs_top_srcdir) == $(DESTDIR)$(prefix) ] && echo "Installing in dist directory, don't copy LICENSE file" || cp $(abs_top_srcdir)/LICENSE $(DESTDIR)$(prefix)/
502        cp $(abs_top_srcdir)/RuntimeLibrary/LICENSE_GPL $(DESTDIR)$(prefix)/lib/
503        cp $(abs_top_srcdir)/RuntimeLibrary/LICENSE_CPL $(DESTDIR)$(prefix)/lib/
504        cp $(abs_top_srcdir)/RuntimeLibrary/LICENSE_GPL $(DESTDIR)$(prefix)/include/
505        cp $(abs_top_srcdir)/RuntimeLibrary/LICENSE_CPL $(DESTDIR)$(prefix)/include/
506        mkdir -p $(DESTDIR)$(prefix)/Makefiles
507        cp $(abs_top_srcdir)/RuntimeLibrary/LICENSE_GPL $(DESTDIR)$(prefix)/Makefiles/LICENSE
508        case $(build) in \
509        *-cygwin*|*-mingw*) \
510        cp $(abs_top_srcdir)/RuntimeLibrary/Makefiles/Makefile.windows $(DESTDIR)$(prefix)/Makefiles/Makefile && \
511        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/winpthreads/lib/winpthreads && \
512        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/winpthreads/include && \
513        cp $(abs_builddir)/winpthreads_build/COPYING $(DESTDIR)$(prefix)/ThirdParty/winpthreads && \
514        cp $(abs_builddir)/winpthreads_build/.libs/libwinpthread.a $(DESTDIR)$(prefix)/ThirdParty/winpthreads/lib/winpthreads && \
515        cp $(abs_builddir)/winpthreads_build/include/*.h $(DESTDIR)$(prefix)/ThirdParty/winpthreads/include ;; \
516        *-apple*) \
517        cp $(abs_top_srcdir)/RuntimeLibrary/Makefiles/Makefile.macosx $(DESTDIR)$(prefix)/Makefiles/MakeFile ;; \
518        *) \
519        cp $(abs_top_srcdir)/RuntimeLibrary/Makefiles/Makefile.linux $(DESTDIR)$(prefix)/Makefiles/MakeFile ;; \
520        esac
521
522if COPY_PTHREADS_LIB
523        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/pthreads/lib
524        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/pthreads/include
525        cp $(abs_top_srcdir)/ThirdParty/pthreads/lib/win32/libpthreadGC2-2-9-1.a $(DESTDIR)$(prefix)/ThirdParty/pthreads/lib
526        cp $(abs_top_srcdir)/ThirdParty/pthreads/include/*.h $(DESTDIR)$(prefix)/ThirdParty/pthreads/include
527endif
528
529        cp $(abs_builddir)/DefaultOptions.xml $(DESTDIR)$(prefix)/DefaultOptions.xml
530        mkdir -p $(DESTDIR)$(prefix)/ThirdParty
531        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/Beaver
532        cp $(abs_top_srcdir)/ThirdParty/Beaver/beaver-0.9.6.1/LICENSE $(DESTDIR)$(prefix)/ThirdParty/Beaver/
533        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/Beaver/lib
534        cp $(abs_top_srcdir)/ThirdParty/Beaver/beaver-0.9.6.1/lib/beaver-rt.jar $(DESTDIR)$(prefix)/ThirdParty/Beaver/lib/
535        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/Sundials
536        cp -r $(SUNDIALS_HOME)/* $(DESTDIR)$(prefix)/ThirdParty/Sundials
537        cp $(abs_top_srcdir)/ThirdParty/Sundials/sundials-2.7.0/LICENSE $(DESTDIR)$(prefix)/ThirdParty/Sundials
538if JM_WIN64
539        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/Sundials/lib64
540        cp -r $(SUNDIALS_HOME)64/lib/* $(DESTDIR)$(prefix)/ThirdParty/Sundials/lib64
541        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/winpthreads/lib/winpthreads64
542        cp $(abs_builddir)/winpthreads_build64/.libs/libwinpthread.a $(DESTDIR)$(prefix)/ThirdParty/winpthreads/lib/winpthreads64
543endif
544        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/Minpack
545        cp -r $(MINPACK_HOME)/* $(DESTDIR)$(prefix)/ThirdParty/Minpack
546        cp $(abs_top_srcdir)/ThirdParty/Minpack/cminpack-1.3.2/CopyrightMINPACK.txt $(DESTDIR)$(prefix)/ThirdParty/Minpack
547        if [ $(abs_top_srcdir) == $(DESTDIR)$(prefix) ]; then \
548          echo "Installing in dist directory, don't copy MSL"; \
549        else \
550          mkdir -p "$(DESTDIR)$(prefix)/ThirdParty/MSL/Modelica"; \
551          mkdir -p "$(DESTDIR)$(prefix)/ThirdParty/MSL/ModelicaServices"; \
552          cd "$(DESTDIR)$(prefix)/ThirdParty/MSL"; \
553          find . -depth -print0 | while read -d $$'\0' -r f ; do if [ ! -e "$(abs_top_srcdir)/ThirdParty/MSL/$${f}" ]; then rm -rf "$${f}"; fi; done; \
554          cd "$(abs_top_srcdir)/ThirdParty/MSL/Modelica"; \
555          find * -type f |grep -v /.svn | grep -v ~ |tar c -T - -f - | tar x -C "$(DESTDIR)$(prefix)/ThirdParty/MSL/Modelica"; \
556          cd "$(abs_top_srcdir)/ThirdParty/MSL/ModelicaServices"; \
557          find * -type f |grep -v /.svn | grep -v ~ |tar c -T - -f - | tar x -C "$(DESTDIR)$(prefix)/ThirdParty/MSL/ModelicaServices"; \
558          cd "$(abs_top_srcdir)/ThirdParty/MSL"; \
559          $(CP) Complex.mo "$(DESTDIR)$(prefix)/ThirdParty/MSL"; \
560        fi
561        mkdir -p $(DESTDIR)$(prefix)/CodeGenTemplates
562        mkdir -p $(DESTDIR)$(prefix)/CodeGenTemplates/FMIBase
563        cp $(abs_top_srcdir)/RuntimeLibrary/LICENSE_GPL $(DESTDIR)$(prefix)/CodeGenTemplates/LICENSE
564        cp -r $(abs_top_srcdir)/Compiler/ModelicaCBackEnd/templates/*.c $(DESTDIR)$(prefix)/CodeGenTemplates
565        cp -r $(abs_top_srcdir)/Compiler/ModelicaCBackEnd/templates/FMIBase/*.c $(DESTDIR)$(prefix)/CodeGenTemplates/FMIBase
566        cp -r $(abs_top_srcdir)/Compiler/ModelicaCBackEnd/templates/FMIBase/*.h $(DESTDIR)$(prefix)/CodeGenTemplates/FMIBase
567        cp  $(abs_top_srcdir)/Compiler/ModelicaFMUXBackEnd/templates/*.tpl $(DESTDIR)$(prefix)/CodeGenTemplates
568        mkdir -p $(DESTDIR)$(prefix)/XML
569        [ $(abs_top_srcdir) == $(DESTDIR)$(prefix) ] && echo "Installing in dist directory, don't copy XML schemas"  || cp  $(abs_top_srcdir)/XML/*.xsd $(DESTDIR)$(prefix)/XML
570        [ $(abs_top_srcdir) == $(DESTDIR)$(prefix) ] && echo "Installing in dist directory, don't copy XML LICENSE"  || cp  $(abs_top_srcdir)/XML/LICENSE $(DESTDIR)$(prefix)/XML
571        cp  $(abs_builddir)/version.txt $(DESTDIR)$(prefix)
572        chmod ugo+x jm_tests
573        cp -p jm_tests $(DESTDIR)$(prefix)/jm_tests
574        if [ "$(INSTALL_EXTRA)" ]; then exec "$(INSTALL_EXTRA)" "$(abs_top_srcdir)" "$(DESTDIR)$(prefix)"; fi
575
576bindistdir: install
577        rm -rf $(bindistdir)
578        mkdir -p $(bindistdir)
579        cp $(DESTDIR)$(prefix)/LICENSE $(bindistdir)
580        cp $(DESTDIR)$(prefix)/startup.py $(bindistdir)
581        cp $(DESTDIR)$(prefix)/version.txt $(bindistdir)
582        cp $(DESTDIR)$(prefix)/DefaultOptions.xml $(bindistdir)
583        cp -r $(DESTDIR)$(prefix)/CodeGenTemplates $(bindistdir)
584        cp -r $(DESTDIR)$(prefix)/Makefiles $(bindistdir)
585        cp -r $(DESTDIR)$(prefix)/Python $(bindistdir)
586        cp -r $(DESTDIR)$(prefix)/ThirdParty $(bindistdir)
587        cp -r $(DESTDIR)$(prefix)/XML $(bindistdir)
588        cp -r $(DESTDIR)$(prefix)/include $(bindistdir)
589        cp -r $(DESTDIR)$(prefix)/lib $(bindistdir)
590if COMPILE_WITH_IPOPT   
591        mkdir -p $(bindistdir)/ThirdParty/Ipopt
592# Copy files
593        cd $(IPOPT_HOME); find * -type f |grep -v /.svn | grep -v ~ |tar c -T - -f - | tar x -C $(abs_builddir)/$(bindistdir)/ThirdParty/Ipopt
594# Copy symbolic links
595        cd $(IPOPT_HOME); find * -type l |grep -v /.svn | grep -v ~ |tar c -T - -f - | tar x -C $(abs_builddir)/$(bindistdir)/ThirdParty/Ipopt
596endif
597
598if WITH_MINGW   
599        mkdir -p $(bindistdir)/ThirdParty/MinGW
600# Copy files
601        cd $(MINGW_HOME); find * -type f |grep -v /.svn | grep -v ~ |tar c -T - -f - | tar x -C $(abs_builddir)/$(bindistdir)/ThirdParty/MinGW
602# Copy symbolic links
603        cd $(MINGW_HOME); find * -type l |grep -v /.svn | grep -v ~ |tar c -T - -f - | tar x -C $(abs_builddir)/$(bindistdir)/ThirdParty/MinGW
604endif
605
606bindist: bindistdir
607        tar -cf $(bindistdir).tar $(bindistdir)
608        gzip -c $(bindistdir).tar > $(bindistdir).tar.gz
609        rm -rf $(bindistdir)
610        rm -rf $(bindistdir).tar
611
612test: install
613        $(prefix)/jm_tests -i
614
615clean-local: clean-frontends clean-python-packages clean-casadi-interface
616
617clean-casadi-interface:
618        rm -rf $(MC_BUILD)
619        rm -rf $(MC_BUILD64)
620#       rm -rf $(DESTDIR)$(prefix)/Python/casadi
621#       rm -rf $(DESTDIR)$(prefix)/Python/modelicacasadi_transfer
622if HAVE_ANT
623        cd $(JAVA_CASADI_BUILD_DIR)/ModelicaCompilerCasADi; \
624        $(ANT_OPTS) $(ANT) clean ; rm -rf $(MC_CASADI_BUILD)/src/cpp-generated $(MC_CASADI_BUILD)/src/java-generated/ifcasadi
625        cd $(JAVA_CASADI_BUILD_DIR)/OptimicaCompilerCasADi; \
626        $(ANT_OPTS) $(ANT) clean ; rm -rf $(OC_CASADI_BUILD)/src/cpp-generated $(OC_CASADI_BUILD)/src/java-generated/ifcasadi
627endif
628       
629
630clean-python-packages:
631if WITH_SUNDIALS
632        if [ -d $(assimulo_build_dir)/Assimulo ]; then \
633                cd $(assimulo_build_dir)/Assimulo; \
634                python setup.py clean --all --sundials-home=$(SUNDIALS_HOME); \
635                cd $(abs_builddir); \
636        fi;
637        rm -rf $(assimulo_build_dir) || echo  Could not remove $(assimulo_build_dir)
638        rm -rf $(assimulo_install_dir) || echo  Could not remove $(assimulo_install_dir)
639endif
640        -cd $(abs_top_srcdir)/Python/src; \
641        python setup_pymodelica.py clean --all
642        -rm -rf $(pymodelica_install_dir) || echo  Could not remove $(pymodelica_install_dir)
643        if [ -d $(pyfmi_build_dir)/PyFMI ]; then \
644                -cd $(pyfmi_build_dir)/PyFMI; \
645                python setup.py  clean --all; \
646                cd $(abs_builddir); \
647        fi;
648        -rm -rf $(pyfmi_build_dir) || echo  Could not remove $(pyfmi_build_dir)
649        -rm -rf $(pyfmi_install_dir) || echo  Could not remove $(pyfmi_install_dir)
650        -cd $(abs_top_srcdir)/Python/src; \
651        python setup_pyjmi.py clean --all
652        -rm -rf $(pyjmi_install_dir)|| echo  Could not remove $(pyjmi_install_dir)
653
654clean-frontends:
655if HAVE_ANT
656        rm -rf $(JAVA_BUILD_DIR)
657endif
658
659docs:
660        cd $(abs_top_srcdir); doxygen doc/ModelicaCompiler/modelica_compiler_doxydoc.conf
661        cd $(abs_top_srcdir); doxygen doc/OptimicaCompiler/optimica_compiler_doxydoc.conf
662        make -C $(abs_top_srcdir)/doc/PyJMI html
663
664
665.PHONY: modelicacasadi_wrapper ifcasadi install_modelicacasadi_transfer install_modelicacasadi_wrapper
Note: See TracBrowser for help on using the repository browser.