source: branches/dev-jo-jastadd/Makefile.am @ 13800

Last change on this file since 13800 was 13223, checked in by Jonathan Kämpe, 5 months ago

#5810 Recommiting r13203,r13193,r13174 with bugfix from r13219

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