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

Last change on this file since 13800 was 12272, checked in by randersson, 11 months ago

#5728 Added changes to build in order to enable/disable python builds

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