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

Last change on this file since 13800 was 10251, checked in by aramle, 2 years ago

#5459 Fixed so that the Python_64 folder isn't created when there
is no Python 64 bit distribution available.

File size: 34.1 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/SuperLU ThirdParty/Sundials ThirdParty/Minpack ThirdParty/Blas ThirdParty/Lapack 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*) \
510        cp $(abs_top_srcdir)/RuntimeLibrary/Makefiles/Makefile.windows $(DESTDIR)$(prefix)/Makefiles/Makefile ;; \
511        *-mingw*) \
512        cp $(abs_top_srcdir)/RuntimeLibrary/Makefiles/Makefile.windows $(DESTDIR)$(prefix)/Makefiles/MakeFile ;; \
513        *-apple*) \
514        cp $(abs_top_srcdir)/RuntimeLibrary/Makefiles/Makefile.macosx $(DESTDIR)$(prefix)/Makefiles/MakeFile ;; \
515        *) \
516        cp $(abs_top_srcdir)/RuntimeLibrary/Makefiles/Makefile.linux $(DESTDIR)$(prefix)/Makefiles/MakeFile ;; \
517        esac
518
519if COPY_PTHREADS_LIB
520        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/pthreads/lib
521        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/pthreads/include
522        cp $(abs_top_srcdir)/ThirdParty/pthreads/lib/win32/libpthreadGC2-2-9-1.a $(DESTDIR)$(prefix)/ThirdParty/pthreads/lib
523        cp $(abs_top_srcdir)/ThirdParty/pthreads/include/*.h $(DESTDIR)$(prefix)/ThirdParty/pthreads/include
524endif
525
526        cp $(abs_builddir)/DefaultOptions.xml $(DESTDIR)$(prefix)/DefaultOptions.xml
527        mkdir -p $(DESTDIR)$(prefix)/ThirdParty
528        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/Beaver
529        cp $(abs_top_srcdir)/ThirdParty/Beaver/beaver-0.9.6.1/LICENSE $(DESTDIR)$(prefix)/ThirdParty/Beaver/
530        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/Beaver/lib
531        cp $(abs_top_srcdir)/ThirdParty/Beaver/beaver-0.9.6.1/lib/beaver-rt.jar $(DESTDIR)$(prefix)/ThirdParty/Beaver/lib/
532        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/Sundials
533        cp -r $(SUNDIALS_HOME)/* $(DESTDIR)$(prefix)/ThirdParty/Sundials
534        cp $(abs_top_srcdir)/ThirdParty/Sundials/sundials-2.7.0/LICENSE $(DESTDIR)$(prefix)/ThirdParty/Sundials
535if JM_WIN64
536        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/Sundials/lib64
537        cp -r $(SUNDIALS_HOME)64/lib/* $(DESTDIR)$(prefix)/ThirdParty/Sundials/lib64
538endif
539        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/Minpack
540        cp -r $(MINPACK_HOME)/* $(DESTDIR)$(prefix)/ThirdParty/Minpack
541        cp $(abs_top_srcdir)/ThirdParty/Minpack/cminpack-1.3.2/CopyrightMINPACK.txt $(DESTDIR)$(prefix)/ThirdParty/Minpack
542        if [ $(abs_top_srcdir) == $(DESTDIR)$(prefix) ]; then \
543          echo "Installing in dist directory, don't copy MSL"; \
544        else \
545          mkdir -p "$(DESTDIR)$(prefix)/ThirdParty/MSL/Modelica"; \
546          mkdir -p "$(DESTDIR)$(prefix)/ThirdParty/MSL/ModelicaServices"; \
547          cd "$(DESTDIR)$(prefix)/ThirdParty/MSL"; \
548          find . -depth -print0 | while read -d $$'\0' -r f ; do if [ ! -e "$(abs_top_srcdir)/ThirdParty/MSL/$${f}" ]; then rm -rf "$${f}"; fi; done; \
549          cd "$(abs_top_srcdir)/ThirdParty/MSL/Modelica"; \
550          find * -type f |grep -v /.svn | grep -v ~ |tar c -T - -f - | tar x -C "$(DESTDIR)$(prefix)/ThirdParty/MSL/Modelica"; \
551          cd "$(abs_top_srcdir)/ThirdParty/MSL/ModelicaServices"; \
552          find * -type f |grep -v /.svn | grep -v ~ |tar c -T - -f - | tar x -C "$(DESTDIR)$(prefix)/ThirdParty/MSL/ModelicaServices"; \
553          cd "$(abs_top_srcdir)/ThirdParty/MSL"; \
554          $(CP) Complex.mo "$(DESTDIR)$(prefix)/ThirdParty/MSL"; \
555        fi
556        mkdir -p $(DESTDIR)$(prefix)/CodeGenTemplates
557        mkdir -p $(DESTDIR)$(prefix)/CodeGenTemplates/FMIBase
558        cp $(abs_top_srcdir)/RuntimeLibrary/LICENSE_GPL $(DESTDIR)$(prefix)/CodeGenTemplates/LICENSE
559        cp -r $(abs_top_srcdir)/Compiler/ModelicaCBackEnd/templates/*.c $(DESTDIR)$(prefix)/CodeGenTemplates
560        cp -r $(abs_top_srcdir)/Compiler/ModelicaCBackEnd/templates/FMIBase/*.c $(DESTDIR)$(prefix)/CodeGenTemplates/FMIBase
561        cp -r $(abs_top_srcdir)/Compiler/ModelicaCBackEnd/templates/FMIBase/*.h $(DESTDIR)$(prefix)/CodeGenTemplates/FMIBase
562        cp  $(abs_top_srcdir)/Compiler/ModelicaFMUXBackEnd/templates/*.tpl $(DESTDIR)$(prefix)/CodeGenTemplates
563        mkdir -p $(DESTDIR)$(prefix)/XML
564        [ $(abs_top_srcdir) == $(DESTDIR)$(prefix) ] && echo "Installing in dist directory, don't copy XML schemas"  || cp  $(abs_top_srcdir)/XML/*.xsd $(DESTDIR)$(prefix)/XML
565        [ $(abs_top_srcdir) == $(DESTDIR)$(prefix) ] && echo "Installing in dist directory, don't copy XML LICENSE"  || cp  $(abs_top_srcdir)/XML/LICENSE $(DESTDIR)$(prefix)/XML
566        cp  $(abs_builddir)/version.txt $(DESTDIR)$(prefix)
567        chmod ugo+x jm_tests
568        cp -p jm_tests $(DESTDIR)$(prefix)/jm_tests
569        if [ "$(INSTALL_EXTRA)" ]; then exec "$(INSTALL_EXTRA)" "$(abs_top_srcdir)" "$(DESTDIR)$(prefix)"; fi
570
571bindistdir: install
572        rm -rf $(bindistdir)
573        mkdir -p $(bindistdir)
574        cp $(DESTDIR)$(prefix)/LICENSE $(bindistdir)
575        cp $(DESTDIR)$(prefix)/startup.py $(bindistdir)
576        cp $(DESTDIR)$(prefix)/version.txt $(bindistdir)
577        cp $(DESTDIR)$(prefix)/DefaultOptions.xml $(bindistdir)
578        cp -r $(DESTDIR)$(prefix)/CodeGenTemplates $(bindistdir)
579        cp -r $(DESTDIR)$(prefix)/Makefiles $(bindistdir)
580        cp -r $(DESTDIR)$(prefix)/Python $(bindistdir)
581        cp -r $(DESTDIR)$(prefix)/ThirdParty $(bindistdir)
582        cp -r $(DESTDIR)$(prefix)/XML $(bindistdir)
583        cp -r $(DESTDIR)$(prefix)/include $(bindistdir)
584        cp -r $(DESTDIR)$(prefix)/lib $(bindistdir)
585if COMPILE_WITH_IPOPT   
586        mkdir -p $(bindistdir)/ThirdParty/Ipopt
587# Copy files
588        cd $(IPOPT_HOME); find * -type f |grep -v /.svn | grep -v ~ |tar c -T - -f - | tar x -C $(abs_builddir)/$(bindistdir)/ThirdParty/Ipopt
589# Copy symbolic links
590        cd $(IPOPT_HOME); find * -type l |grep -v /.svn | grep -v ~ |tar c -T - -f - | tar x -C $(abs_builddir)/$(bindistdir)/ThirdParty/Ipopt
591endif
592
593if WITH_MINGW   
594        mkdir -p $(bindistdir)/ThirdParty/MinGW
595# Copy files
596        cd $(MINGW_HOME); find * -type f |grep -v /.svn | grep -v ~ |tar c -T - -f - | tar x -C $(abs_builddir)/$(bindistdir)/ThirdParty/MinGW
597# Copy symbolic links
598        cd $(MINGW_HOME); find * -type l |grep -v /.svn | grep -v ~ |tar c -T - -f - | tar x -C $(abs_builddir)/$(bindistdir)/ThirdParty/MinGW
599endif
600
601bindist: bindistdir
602        tar -cf $(bindistdir).tar $(bindistdir)
603        gzip -c $(bindistdir).tar > $(bindistdir).tar.gz
604        rm -rf $(bindistdir)
605        rm -rf $(bindistdir).tar
606
607test: install
608        $(prefix)/jm_tests -i
609
610clean-local: clean-frontends clean-python-packages clean-casadi-interface
611
612clean-casadi-interface:
613        rm -rf $(MC_BUILD)
614        rm -rf $(MC_BUILD64)
615#       rm -rf $(DESTDIR)$(prefix)/Python/casadi
616#       rm -rf $(DESTDIR)$(prefix)/Python/modelicacasadi_transfer
617if HAVE_ANT
618        cd $(JAVA_CASADI_BUILD_DIR)/ModelicaCompilerCasADi; \
619        $(ANT_OPTS) $(ANT) clean ; rm -rf $(MC_CASADI_BUILD)/src/cpp-generated $(MC_CASADI_BUILD)/src/java-generated/ifcasadi
620        cd $(JAVA_CASADI_BUILD_DIR)/OptimicaCompilerCasADi; \
621        $(ANT_OPTS) $(ANT) clean ; rm -rf $(OC_CASADI_BUILD)/src/cpp-generated $(OC_CASADI_BUILD)/src/java-generated/ifcasadi
622endif
623       
624
625clean-python-packages:
626if WITH_SUNDIALS
627        if [ -d $(assimulo_build_dir)/Assimulo ]; then \
628                cd $(assimulo_build_dir)/Assimulo; \
629                python setup.py clean --all --sundials-home=$(SUNDIALS_HOME); \
630                cd $(abs_builddir); \
631        fi;
632        rm -rf $(assimulo_build_dir) || echo  Could not remove $(assimulo_build_dir)
633        rm -rf $(assimulo_install_dir) || echo  Could not remove $(assimulo_install_dir)
634endif
635        -cd $(abs_top_srcdir)/Python/src; \
636        python setup_pymodelica.py clean --all
637        -rm -rf $(pymodelica_install_dir) || echo  Could not remove $(pymodelica_install_dir)
638        if [ -d $(pyfmi_build_dir)/PyFMI ]; then \
639                -cd $(pyfmi_build_dir)/PyFMI; \
640                python setup.py  clean --all; \
641                cd $(abs_builddir); \
642        fi;
643        -rm -rf $(pyfmi_build_dir) || echo  Could not remove $(pyfmi_build_dir)
644        -rm -rf $(pyfmi_install_dir) || echo  Could not remove $(pyfmi_install_dir)
645        -cd $(abs_top_srcdir)/Python/src; \
646        python setup_pyjmi.py clean --all
647        -rm -rf $(pyjmi_install_dir)|| echo  Could not remove $(pyjmi_install_dir)
648
649clean-frontends:
650if HAVE_ANT
651        rm -rf $(JAVA_BUILD_DIR)
652endif
653
654docs:
655        cd $(abs_top_srcdir); doxygen doc/ModelicaCompiler/modelica_compiler_doxydoc.conf
656        cd $(abs_top_srcdir); doxygen doc/OptimicaCompiler/optimica_compiler_doxydoc.conf
657        make -C $(abs_top_srcdir)/doc/PyJMI html
658
659
660.PHONY: modelicacasadi_wrapper ifcasadi install_modelicacasadi_transfer install_modelicacasadi_wrapper
Note: See TracBrowser for help on using the repository browser.