source: branches/2.6.x/Makefile.am @ 13800

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

Removed unused code in the configure script. Related to ticket:5702

File size: 34.2 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_OPENMP
256        mkdir -p $(assimulo_build_dir); \
257        cd $(abs_top_srcdir)/external; \
258        find Assimulo -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(assimulo_build_dir); \
259        cd $(assimulo_build_dir)/Assimulo; \
260        case $(build) in \
261        *-cygwin*) \
262        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) ;; \
263        *-mingw*) \
264        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) ;; \
265        *) \
266        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) ;; \
267        esac
268if JM_WIN64
269if WITH_PYTHON64
270        mkdir -p $(assimulo_build_dir64); \
271        cd $(abs_top_srcdir)/external; \
272        find Assimulo -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(assimulo_build_dir64); \
273        cd $(assimulo_build_dir)/Assimulo; \
274        export PATH=$(PYTHON64_HOME):$(PYTHON64_HOME)/Scripts:$(PYTHON64_HOME)/Lib:"${PATH}"; \
275        export PYTHONHOME=$(PYTHON64_HOME); \
276        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); \
277        export PATH="$(ORIG_PATH)"; \
278        export PYTHONHOME=$(ORIG_PYTHON_HOME)
279endif
280endif
281endif
282if !WITH_OPENMP
283        mkdir -p $(assimulo_build_dir); \
284        cd $(abs_top_srcdir)/external; \
285        find Assimulo -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(assimulo_build_dir); \
286        cd $(assimulo_build_dir)/Assimulo; \
287        case $(build) in \
288        *-cygwin*) \
289        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) ;; \
290        *-mingw*) \
291        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) ;; \
292        *) \
293        python setup.py install --sundials-home=$(SUNDIALS_HOME) --blas-home=$(abs_builddir)/blas_install/ --lapack-home=$(abs_builddir)/lapack_install/ --prefix=$(assimulo_install_dir) ;; \
294        esac
295if JM_WIN64
296if WITH_PYTHON64
297        mkdir -p $(assimulo_build_dir64); \
298        cd $(abs_top_srcdir)/external; \
299        find Assimulo -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(assimulo_build_dir64); \
300        cd $(assimulo_build_dir64)/Assimulo; \
301        export PATH=$(PYTHON64_HOME):$(PYTHON64_HOME)/Scripts:$(PYTHON64_HOME)/Lib:"${PATH}"; \
302        export PYTHONHOME=$(PYTHON64_HOME); \
303        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) ; \
304        export PATH="$(ORIG_PATH)"; \
305        export PYTHONHOME=$(ORIG_PYTHON_HOME)
306endif
307endif
308endif
309        cd $(abs_top_srcdir)/Python/src; \
310        python setup_pymodelica.py install --prefix=$(pymodelica_install_dir); \
311        rm -rf build
312if JM_WIN64
313if WITH_PYTHON64
314        cd $(abs_top_srcdir)/Python/src; \
315        export PATH=$(PYTHON64_HOME):$(PYTHON64_HOME)/Scripts:$(PYTHON64_HOME)/Lib:"${PATH}"; \
316        export PYTHONHOME=$(PYTHON64_HOME); \
317        python setup_pymodelica.py install --prefix=$(pymodelica_install_dir64); \
318        export PATH="$(ORIG_PATH)"; \
319        export PYTHONHOME=$(ORIG_PYTHON_HOME); \
320        rm -rf build
321endif
322endif
323        mkdir -p $(pyfmi_build_dir); \
324        cd $(abs_top_srcdir)/external; \
325        find PyFMI -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(pyfmi_build_dir); \
326        cd $(pyfmi_build_dir)/PyFMI; \
327        case $(build) in \
328        *-cygwin*) \
329        python setup.py install --fmil-home=$(abs_builddir)/FMIL_install/ --force-32bit="true" --extra-c-flags="-mincoming-stack-boundary=2" --prefix=$(pyfmi_install_dir) ;; \
330        *-mingw*) \
331        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) ;; \
332        *) \
333        python setup.py install --fmil-home=$(abs_builddir)/FMIL_install/ --prefix=$(pyfmi_install_dir) ;; \
334        esac
335        rm -rf build
336if JM_WIN64
337if WITH_PYTHON64
338        mkdir -p $(pyfmi_build_dir64); \
339        cd $(abs_top_srcdir)/external; \
340        find PyFMI -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(pyfmi_build_dir64); \
341        cd $(pyfmi_build_dir64)/PyFMI; \
342        export PATH=$(PYTHON64_HOME):$(PYTHON64_HOME)/Scripts:$(PYTHON64_HOME)/Lib:"${PATH}"; \
343        export PYTHONHOME=$(PYTHON64_HOME); \
344        python setup.py install --fmil-home=$(abs_builddir)/FMIL_install64/ $(NUMPY_NO_MSVCR_ARG) --prefix=$(pyfmi_install_dir64); \
345        export PATH="$(ORIG_PATH)"; \
346        export PYTHONHOME=$(ORIG_PYTHON_HOME); \
347        rm -rf build
348endif
349endif
350        cd $(abs_top_srcdir)/Python/src; \
351        python setup_pyjmi.py install --prefix=$(pyjmi_install_dir); \
352        rm -rf build
353if JM_WIN64
354if WITH_PYTHON64
355        cd $(abs_top_srcdir)/Python/src; \
356        export PATH=$(PYTHON64_HOME):$(PYTHON64_HOME)/Scripts:$(PYTHON64_HOME)/Lib:"${PATH}"; \
357        export PYTHONHOME=$(PYTHON64_HOME); \
358        python setup_pyjmi.py install --prefix=$(pyjmi_install_dir64); \
359        export PATH="$(ORIG_PATH)"; \
360        export PYTHONHOME=$(ORIG_PYTHON_HOME); \
361        rm -rf build
362endif
363endif
364install-python-packages: build-python-packages
365        mkdir -p $(DESTDIR)$(prefix)/Python
366        cp $(abs_top_srcdir)/Python/src/startup.py $(DESTDIR)$(prefix)/
367        cp Python/src/required_defaults.py $(DESTDIR)$(prefix)/Python/
368        [ $(abs_top_srcdir) == $(DESTDIR)$(prefix) ] && echo "Installing in dist directory, don't copy LICENSE file" || cp $(abs_top_srcdir)/Python/LICENSE $(DESTDIR)$(prefix)/Python
369if JM_WIN64
370if WITH_PYTHON64
371        mkdir -p $(DESTDIR)$(prefix)/Python_64
372        cp Python/src/required_defaults.py $(DESTDIR)$(prefix)/Python_64/
373        [ $(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
374endif
375endif
376        for pkgdir in lib/python2.5 lib/python2.6 lib/python2.7 lib64/python2.5 lib64/python2.6 lib64/python2.7 Lib; do \
377        if [ -e $(assimulo_install_dir)/$${pkgdir}/site-packages/ ]; \
378        then \
379        cd $(assimulo_install_dir)/$${pkgdir}/site-packages/; \
380        find assimulo -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(DESTDIR)$(prefix)/Python; \
381        fi; \
382        done
383        for pkgdir in lib/python2.5 lib/python2.6 lib/python2.7 lib64/python2.5 lib64/python2.6 lib64/python2.7 Lib; do \
384        if [ -e $(pymodelica_install_dir)/$${pkgdir}/site-packages/ ]; \
385        then \
386        cd $(pymodelica_install_dir)/$${pkgdir}/site-packages/; \
387        find pymodelica -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(DESTDIR)$(prefix)/Python; \
388        fi; \
389        done
390        for pkgdir in lib/python2.5 lib/python2.6 lib/python2.7 lib64/python2.5 lib64/python2.6 lib64/python2.7 Lib; do \
391        if [ -e $(pyjmi_install_dir)/$${pkgdir}/site-packages/ ]; \
392        then \
393        cd $(pyjmi_install_dir)/$${pkgdir}/site-packages/; \
394        find pyjmi -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(DESTDIR)$(prefix)/Python; \
395        fi; \
396        done
397        for pkgdir in lib/python2.5 lib/python2.6 lib/python2.7 lib64/python2.5 lib64/python2.6 lib64/python2.7 Lib; do \
398        if [ -e $(pyfmi_install_dir)/$${pkgdir}/site-packages/ ]; \
399        then \
400        cd $(pyfmi_install_dir)/$${pkgdir}/site-packages/; \
401        find pyfmi -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(DESTDIR)$(prefix)/Python; \
402        fi; \
403        done
404        cd $(abs_top_srcdir)/Python/src/tests_jmodelica/; \
405        mkdir -p $(DESTDIR)$(prefix)/Python/tests_jmodelica; \
406        find . -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(DESTDIR)$(prefix)/Python/tests_jmodelica
407if JM_WIN64
408        for pkgdir in lib/python2.5 lib/python2.6 lib/python2.7 lib64/python2.5 lib64/python2.6 lib64/python2.7 Lib; do \
409        if [ -e $(assimulo_install_dir64)/$${pkgdir}/site-packages/ ]; \
410        then \
411        cd $(assimulo_install_dir64)/$${pkgdir}/site-packages/; \
412        find assimulo -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(DESTDIR)$(prefix)/Python_64; \
413        fi; \
414        done
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 $(pymodelica_install_dir64)/$${pkgdir}/site-packages/ ]; \
417        then \
418        cd $(pymodelica_install_dir64)/$${pkgdir}/site-packages/; \
419        find pymodelica -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
422        for pkgdir in lib/python2.5 lib/python2.6 lib/python2.7 lib64/python2.5 lib64/python2.6 lib64/python2.7 Lib; do \
423        if [ -e $(pyjmi_install_dir64)/$${pkgdir}/site-packages/ ]; \
424        then \
425        cd $(pyjmi_install_dir64)/$${pkgdir}/site-packages/; \
426        find pyjmi -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(DESTDIR)$(prefix)/Python_64; \
427        fi; \
428        done
429        for pkgdir in lib/python2.5 lib/python2.6 lib/python2.7 lib64/python2.5 lib64/python2.6 lib64/python2.7 Lib; do \
430        if [ -e $(pyfmi_install_dir64)/$${pkgdir}/site-packages/ ]; \
431        then \
432        cd $(pyfmi_install_dir64)/$${pkgdir}/site-packages/; \
433        find pyfmi -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(DESTDIR)$(prefix)/Python_64; \
434        fi; \
435        done
436if WITH_PYTHON64
437        cd $(abs_top_srcdir)/Python/src/tests_jmodelica/; \
438        mkdir -p $(DESTDIR)$(prefix)/Python_64/tests_jmodelica; \
439        find . -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(DESTDIR)$(prefix)/Python_64/tests_jmodelica
440        rm -rf $(DESTDIR)$(prefix)/Python_64/tests_jmodelica/files/Modelica/Resources/src
441        rm -f $(DESTDIR)$(prefix)/Python_64/tests_jmodelica/files/Modelica/Resources/CMakeLists.txt
442        rm -f $(DESTDIR)$(prefix)/Python_64/tests_jmodelica/files/Modelica/Resources/Makefile.am
443        rm -f $(DESTDIR)$(prefix)/Python_64/tests_jmodelica/files/Modelica/Resources/Makefile.in
444endif
445endif
446        rm -rf $(DESTDIR)$(prefix)/Python/tests_jmodelica/files/Modelica/Resources/src
447        rm -f $(DESTDIR)$(prefix)/Python/tests_jmodelica/files/Modelica/Resources/CMakeLists.txt
448        rm -f $(DESTDIR)$(prefix)/Python/tests_jmodelica/files/Modelica/Resources/Makefile.am
449        rm -f $(DESTDIR)$(prefix)/Python/tests_jmodelica/files/Modelica/Resources/Makefile.in
450        mkdir -p $(DESTDIR)$(prefix)/bin
451        [ -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
452        [ -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
453        chmod ugo+x $(DESTDIR)$(prefix)/bin/jm_*.sh
454
455# Hooks for extra build or install actions. Must be empty or the path of a shell script to execute.
456# Both scripts will get the source directory as the first argument and the install directory as the second.
457BUILD_EXTRA=
458INSTALL_EXTRA=
459INSTALL_EXTRA_CASADI=
460
461# Paths for Java build
462JAVA_BUILD_DIR=$(abs_builddir)/java
463COMPILER_DIR=$(abs_top_srcdir)/Compiler
464JAVA_MC_ANT_FILE=$(COMPILER_DIR)/ModelicaCompiler/build.xml
465JAVA_OC_ANT_FILE=$(COMPILER_DIR)/OptimicaCompiler/build.xml
466JAVA_CASADI_BASE_DIR=$(COMPILER_DIR)
467JAVA_CASADI_BUILD_DIR=$(abs_builddir)
468JAVA_MC_CASADI_ANT_FILE=$(COMPILER_DIR)/ModelicaCompilerCasADi/build.xml
469JAVA_OC_CASADI_ANT_FILE=$(COMPILER_DIR)/OptimicaCompilerCasADi/build.xml
470JAVA_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
471
472all-local: build-python-packages build-compiler
473        $(abs_top_srcdir)/get_version.sh $(abs_top_srcdir) https://svn.jmodelica.org > $(abs_builddir)/version.txt
474        if [ "$(BUILD_EXTRA)" ]; then exec "$(BUILD_EXTRA)" "$(abs_top_srcdir)" "$(DESTDIR)$(prefix)"; fi
475
476build-compiler:
477if HAVE_ANT
478        mkdir -p $(JAVA_BUILD_DIR)
479        cd $(JAVA_BUILD_DIR); \
480        $(ANT_OPTS) $(ANT) -f "$(JAVA_MC_ANT_FILE)" "-Dcompiler=$(COMPILER_DIR)"
481        cd $(JAVA_BUILD_DIR); \
482        $(ANT_OPTS) $(ANT) -f "$(JAVA_OC_ANT_FILE)" "-Dcompiler=$(COMPILER_DIR)"
483        java -cp "$(JAVA_EXEC_CP)" org.jmodelica.modelica.compiler.ModelicaCompiler\$$OptionExporter -x "$(abs_builddir)/DefaultOptions.xml"
484endif
485
486install-exec-local: install-python-packages
487if HAVE_ANT
488        cp $(JAVA_BUILD_DIR)/bin/ModelicaCompiler.jar $(DESTDIR)$(prefix)/lib/
489        cp $(JAVA_BUILD_DIR)/bin/util.jar $(DESTDIR)$(prefix)/lib/
490        cp $(JAVA_BUILD_DIR)/bin/OptimicaCompiler.jar $(DESTDIR)$(prefix)/lib/
491        cp $(JAVA_BUILD_DIR)/bin/separateProcess.jar $(DESTDIR)$(prefix)/lib/
492endif
493        [ $(abs_top_srcdir) == $(DESTDIR)$(prefix) ] && echo "Installing in dist directory, don't copy LICENSE file" || cp $(abs_top_srcdir)/LICENSE $(DESTDIR)$(prefix)/
494        cp $(abs_top_srcdir)/RuntimeLibrary/LICENSE_GPL $(DESTDIR)$(prefix)/lib/
495        cp $(abs_top_srcdir)/RuntimeLibrary/LICENSE_CPL $(DESTDIR)$(prefix)/lib/
496        cp $(abs_top_srcdir)/RuntimeLibrary/LICENSE_GPL $(DESTDIR)$(prefix)/include/
497        cp $(abs_top_srcdir)/RuntimeLibrary/LICENSE_CPL $(DESTDIR)$(prefix)/include/
498        mkdir -p $(DESTDIR)$(prefix)/Makefiles
499        cp $(abs_top_srcdir)/RuntimeLibrary/LICENSE_GPL $(DESTDIR)$(prefix)/Makefiles/LICENSE
500        case $(build) in \
501        *-cygwin*|*-mingw*) \
502        cp $(abs_top_srcdir)/RuntimeLibrary/Makefiles/Makefile.windows $(DESTDIR)$(prefix)/Makefiles/MakeFile && \
503        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/winpthreads/lib/winpthreads && \
504        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/winpthreads/include && \
505        cp $(abs_builddir)/winpthreads_build/COPYING $(DESTDIR)$(prefix)/ThirdParty/winpthreads && \
506        cp $(abs_builddir)/winpthreads_build/.libs/libwinpthread.a $(DESTDIR)$(prefix)/ThirdParty/winpthreads/lib/winpthreads && \
507        cp $(abs_builddir)/winpthreads_build/include/*.h $(DESTDIR)$(prefix)/ThirdParty/winpthreads/include ;; \
508        *-apple*) \
509        cp $(abs_top_srcdir)/RuntimeLibrary/Makefiles/Makefile.macosx $(DESTDIR)$(prefix)/Makefiles/MakeFile ;; \
510        *) \
511        cp $(abs_top_srcdir)/RuntimeLibrary/Makefiles/Makefile.linux $(DESTDIR)$(prefix)/Makefiles/MakeFile ;; \
512        esac
513
514        cp $(abs_builddir)/DefaultOptions.xml $(DESTDIR)$(prefix)/DefaultOptions.xml
515        mkdir -p $(DESTDIR)$(prefix)/ThirdParty
516        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/Beaver
517        cp $(abs_top_srcdir)/ThirdParty/Beaver/beaver-0.9.6.1/LICENSE $(DESTDIR)$(prefix)/ThirdParty/Beaver/
518        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/Beaver/lib
519        cp $(abs_top_srcdir)/ThirdParty/Beaver/beaver-0.9.6.1/lib/beaver-rt.jar $(DESTDIR)$(prefix)/ThirdParty/Beaver/lib/
520        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/Sundials
521        cp -r $(SUNDIALS_HOME)/* $(DESTDIR)$(prefix)/ThirdParty/Sundials
522        cp $(abs_top_srcdir)/ThirdParty/Sundials/sundials-2.7.0/LICENSE $(DESTDIR)$(prefix)/ThirdParty/Sundials
523if JM_WIN64
524        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/Sundials/lib64
525        cp -r $(SUNDIALS_HOME)64/lib/* $(DESTDIR)$(prefix)/ThirdParty/Sundials/lib64
526        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/winpthreads/lib/winpthreads64
527        cp $(abs_builddir)/winpthreads_build64/.libs/libwinpthread.a $(DESTDIR)$(prefix)/ThirdParty/winpthreads/lib/winpthreads64
528endif
529        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/Minpack
530        cp -r $(MINPACK_HOME)/* $(DESTDIR)$(prefix)/ThirdParty/Minpack
531        cp $(abs_top_srcdir)/ThirdParty/Minpack/cminpack-1.3.2/CopyrightMINPACK.txt $(DESTDIR)$(prefix)/ThirdParty/Minpack
532        if [ $(abs_top_srcdir) == $(DESTDIR)$(prefix) ]; then \
533          echo "Installing in dist directory, don't copy MSL"; \
534        else \
535          mkdir -p "$(DESTDIR)$(prefix)/ThirdParty/MSL/Modelica"; \
536          mkdir -p "$(DESTDIR)$(prefix)/ThirdParty/MSL/ModelicaServices"; \
537          cd "$(DESTDIR)$(prefix)/ThirdParty/MSL"; \
538          find . -depth -print0 | while read -d $$'\0' -r f ; do if [ ! -e "$(abs_top_srcdir)/ThirdParty/MSL/$${f}" ]; then rm -rf "$${f}"; fi; done; \
539          cd "$(abs_top_srcdir)/ThirdParty/MSL/Modelica"; \
540          find * -type f |grep -v /.svn | grep -v ~ |tar c -T - -f - | tar x -C "$(DESTDIR)$(prefix)/ThirdParty/MSL/Modelica"; \
541          cd "$(abs_top_srcdir)/ThirdParty/MSL/ModelicaServices"; \
542          find * -type f |grep -v /.svn | grep -v ~ |tar c -T - -f - | tar x -C "$(DESTDIR)$(prefix)/ThirdParty/MSL/ModelicaServices"; \
543          cd "$(abs_top_srcdir)/ThirdParty/MSL"; \
544          $(CP) Complex.mo "$(DESTDIR)$(prefix)/ThirdParty/MSL"; \
545        fi
546        mkdir -p $(DESTDIR)$(prefix)/CodeGenTemplates
547        mkdir -p $(DESTDIR)$(prefix)/CodeGenTemplates/FMIBase
548        cp $(abs_top_srcdir)/RuntimeLibrary/LICENSE_GPL $(DESTDIR)$(prefix)/CodeGenTemplates/LICENSE
549        cp -r $(abs_top_srcdir)/Compiler/ModelicaCBackEnd/templates/*.c $(DESTDIR)$(prefix)/CodeGenTemplates
550        cp -r $(abs_top_srcdir)/Compiler/ModelicaCBackEnd/templates/FMIBase/*.c $(DESTDIR)$(prefix)/CodeGenTemplates/FMIBase
551        cp -r $(abs_top_srcdir)/Compiler/ModelicaCBackEnd/templates/FMIBase/*.h $(DESTDIR)$(prefix)/CodeGenTemplates/FMIBase
552        cp  $(abs_top_srcdir)/Compiler/ModelicaFMUXBackEnd/templates/*.tpl $(DESTDIR)$(prefix)/CodeGenTemplates
553        mkdir -p $(DESTDIR)$(prefix)/XML
554        [ $(abs_top_srcdir) == $(DESTDIR)$(prefix) ] && echo "Installing in dist directory, don't copy XML schemas"  || cp  $(abs_top_srcdir)/XML/*.xsd $(DESTDIR)$(prefix)/XML
555        [ $(abs_top_srcdir) == $(DESTDIR)$(prefix) ] && echo "Installing in dist directory, don't copy XML LICENSE"  || cp  $(abs_top_srcdir)/XML/LICENSE $(DESTDIR)$(prefix)/XML
556        cp  $(abs_builddir)/version.txt $(DESTDIR)$(prefix)
557        chmod ugo+x jm_tests
558        cp -p jm_tests $(DESTDIR)$(prefix)/jm_tests
559        if [ "$(INSTALL_EXTRA)" ]; then exec "$(INSTALL_EXTRA)" "$(abs_top_srcdir)" "$(DESTDIR)$(prefix)"; fi
560
561bindistdir: install
562        rm -rf $(bindistdir)
563        mkdir -p $(bindistdir)
564        cp $(DESTDIR)$(prefix)/LICENSE $(bindistdir)
565        cp $(DESTDIR)$(prefix)/startup.py $(bindistdir)
566        cp $(DESTDIR)$(prefix)/version.txt $(bindistdir)
567        cp $(DESTDIR)$(prefix)/DefaultOptions.xml $(bindistdir)
568        cp -r $(DESTDIR)$(prefix)/CodeGenTemplates $(bindistdir)
569        cp -r $(DESTDIR)$(prefix)/Makefiles $(bindistdir)
570        cp -r $(DESTDIR)$(prefix)/Python $(bindistdir)
571        cp -r $(DESTDIR)$(prefix)/ThirdParty $(bindistdir)
572        cp -r $(DESTDIR)$(prefix)/XML $(bindistdir)
573        cp -r $(DESTDIR)$(prefix)/include $(bindistdir)
574        cp -r $(DESTDIR)$(prefix)/lib $(bindistdir)
575if COMPILE_WITH_IPOPT   
576        mkdir -p $(bindistdir)/ThirdParty/Ipopt
577# Copy files
578        cd $(IPOPT_HOME); find * -type f |grep -v /.svn | grep -v ~ |tar c -T - -f - | tar x -C $(abs_builddir)/$(bindistdir)/ThirdParty/Ipopt
579# Copy symbolic links
580        cd $(IPOPT_HOME); find * -type l |grep -v /.svn | grep -v ~ |tar c -T - -f - | tar x -C $(abs_builddir)/$(bindistdir)/ThirdParty/Ipopt
581endif
582
583if WITH_MINGW   
584        mkdir -p $(bindistdir)/ThirdParty/MinGW
585# Copy files
586        cd $(MINGW_HOME); find * -type f |grep -v /.svn | grep -v ~ |tar c -T - -f - | tar x -C $(abs_builddir)/$(bindistdir)/ThirdParty/MinGW
587# Copy symbolic links
588        cd $(MINGW_HOME); find * -type l |grep -v /.svn | grep -v ~ |tar c -T - -f - | tar x -C $(abs_builddir)/$(bindistdir)/ThirdParty/MinGW
589endif
590
591bindist: bindistdir
592        tar -cf $(bindistdir).tar $(bindistdir)
593        gzip -c $(bindistdir).tar > $(bindistdir).tar.gz
594        rm -rf $(bindistdir)
595        rm -rf $(bindistdir).tar
596
597test: install
598        $(prefix)/jm_tests -i
599
600clean-local: clean-frontends clean-python-packages clean-casadi-interface
601
602clean-casadi-interface:
603        rm -rf $(MC_BUILD)
604        rm -rf $(MC_BUILD64)
605#       rm -rf $(DESTDIR)$(prefix)/Python/casadi
606#       rm -rf $(DESTDIR)$(prefix)/Python/modelicacasadi_transfer
607if HAVE_ANT
608        cd $(JAVA_CASADI_BUILD_DIR)/ModelicaCompilerCasADi; \
609        $(ANT_OPTS) $(ANT) clean ; rm -rf $(MC_CASADI_BUILD)/src/cpp-generated $(MC_CASADI_BUILD)/src/java-generated/ifcasadi
610        cd $(JAVA_CASADI_BUILD_DIR)/OptimicaCompilerCasADi; \
611        $(ANT_OPTS) $(ANT) clean ; rm -rf $(OC_CASADI_BUILD)/src/cpp-generated $(OC_CASADI_BUILD)/src/java-generated/ifcasadi
612endif
613       
614
615clean-python-packages:
616        if [ -d $(assimulo_build_dir)/Assimulo ]; then \
617                cd $(assimulo_build_dir)/Assimulo; \
618                python setup.py clean --all --sundials-home=$(SUNDIALS_HOME); \
619                cd $(abs_builddir); \
620        fi;
621        rm -rf $(assimulo_build_dir) || echo  Could not remove $(assimulo_build_dir)
622        rm -rf $(assimulo_install_dir) || echo  Could not remove $(assimulo_install_dir)
623        -cd $(abs_top_srcdir)/Python/src; \
624        python setup_pymodelica.py clean --all
625        -rm -rf $(pymodelica_install_dir) || echo  Could not remove $(pymodelica_install_dir)
626        if [ -d $(pyfmi_build_dir)/PyFMI ]; then \
627                -cd $(pyfmi_build_dir)/PyFMI; \
628                python setup.py  clean --all; \
629                cd $(abs_builddir); \
630        fi;
631        -rm -rf $(pyfmi_build_dir) || echo  Could not remove $(pyfmi_build_dir)
632        -rm -rf $(pyfmi_install_dir) || echo  Could not remove $(pyfmi_install_dir)
633        -cd $(abs_top_srcdir)/Python/src; \
634        python setup_pyjmi.py clean --all
635        -rm -rf $(pyjmi_install_dir)|| echo  Could not remove $(pyjmi_install_dir)
636
637clean-frontends:
638if HAVE_ANT
639        rm -rf $(JAVA_BUILD_DIR)
640endif
641
642docs:
643        cd $(abs_top_srcdir); doxygen doc/ModelicaCompiler/modelica_compiler_doxydoc.conf
644        cd $(abs_top_srcdir); doxygen doc/OptimicaCompiler/optimica_compiler_doxydoc.conf
645        make -C $(abs_top_srcdir)/doc/PyJMI html
646
647
648.PHONY: modelicacasadi_wrapper ifcasadi install_modelicacasadi_transfer install_modelicacasadi_wrapper
Note: See TracBrowser for help on using the repository browser.