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

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

#4215 Split code generation templates into several and generated source into several files.

File size: 21.8 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
19
20# EXTRA_DIST =
21
22# SUBDIRS = ThirdParty/Sundials ThirdParty/Zlib ThirdParty/Minizip ThirdParty/Expat JMI/src ThirdParty/Blas ThirdParty/Lapack external/FMILibrary
23SUBDIRS = ThirdParty/Sundials ThirdParty/Minpack JMI/src ThirdParty/Blas ThirdParty/Lapack external/FMILibrary RuntimeLibrary Python/src/tests_jmodelica/files/Modelica/Resources
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
29
30bindistdir=JModelica.org-$(VERSION)-bin
31
32casadi:
33        cd $(abs_builddir)/ThirdParty/CasADi; \
34        make -f Makefile CMAKE_PYTHON_LIBRARY=$(PYTHON_LIB) CMAKE_PYTHON_INCLUDE_DIR=$(PYTHON_INCLUDE)
35
36install_casadi: casadi
37        cd $(abs_builddir)/ThirdParty/CasADi; \
38        make -f Makefile install CMAKE_PYTHON_LIBRARY=$(PYTHON_LIB) CMAKE_PYTHON_INCLUDE_DIR=$(PYTHON_INCLUDE) 
39        mkdir -p $(DESTDIR)$(prefix)/Python/
40        cp -r $(abs_builddir)/casadi_install/casadi $(DESTDIR)$(prefix)/Python/
41        ## temp fix
42        cp $(abs_builddir)/casadi_build/swig/casadi_core.py $(DESTDIR)$(prefix)/Python/casadi
43
44## Install for CasADiInterface, Variables and targets.
45## MC_interface installs the system with Python.
46## If C++ compilation/tests are wanted there is the target MC_interface_cplusplus
47
48MC_INTERFACE=$(abs_top_srcdir)/ModelicaCasADiInterface
49
50export CASADI_HOME=$(abs_top_srcdir)/ThirdParty/CasADi/CasADi
51MC_SRC=$(abs_top_srcdir)/Compiler/ModelicaCompilerCasADi
52OC_SRC=$(abs_top_srcdir)/Compiler/OptimicaCompilerCasADi
53
54# The modelica casadi interface is built into a build folder
55MC_BUILD=$(abs_builddir)/ModelicaCasADiInterfaceBuild
56# Jars from the modified modelica and optimica compilers are put into the JModelica folder
57MC_COMPILERS_DIR=$(MC_BUILD)/JModelica.org
58MC_LIB=$(DESTDIR)$(prefix)/lib/casadi_interface
59
60CASADI_BUILD_DIR=$(abs_builddir)/casadi_build
61
62
63# The CMake for ModelicaCasADi needs these variables.
64export MODELICA_CASADI_HOME= $(MC_INTERFACE)
65export MC_BUILD
66export IPOPT_HOME
67export CASADI_BUILD_DIR
68 
69casadi_interface: casadi install_casadi $(MC_LIB) modelicacasadi_wrapper $(DESTDIR)$(prefix)/Python/modelicacasadi_transfer/__init__.py $(DESTDIR)$(prefix)/Python/modelicacasadi_wrapper/__init__.py $(DESTDIR)$(prefix)/Python/modelicacasadi_transfer/modelica_casadi_transfer_wrapper.py
70        if [ "$(INSTALL_EXTRA_CASADI)" ]; then exec "$(INSTALL_EXTRA_CASADI)" "$(abs_top_srcdir)" "$(DESTDIR)$(prefix)"; fi
71
72ifcasadi: casadi
73        mkdir -p $(MC_BUILD)/ifcasadi; \
74        cd $(MC_BUILD)/ifcasadi; \
75        case $(build) in \
76        *-cygwin*) \
77        cmake $(MC_SRC)/src/swig -G "MSYS Makefiles" -DCMAKE_CXX_COMPILER_ARG1="-m32" -DCMAKE_CXX_FLAGS="-m32" ;; \
78        *-mingw*) \
79        cmake $(MC_SRC)/src/swig -G "MSYS Makefiles" -DCMAKE_CXX_COMPILER_ARG1="-m32" -DCMAKE_CXX_FLAGS="-m32" ;; \
80        *) \
81        cmake $(MC_SRC)/src/swig ;; \
82        esac
83        cd $(MC_BUILD)/ifcasadi;  make
84
85$(MC_LIB): $(MC_SRC)/bin/ModelicaCompiler.jar $(OC_SRC)/bin/OptimicaCompiler.jar $(MC_SRC)/bin/util.jar ifcasadi
86        rm -rf $(MC_LIB)
87        mkdir -p $(MC_LIB)
88        cp $(MC_SRC)/bin/ModelicaCompiler.jar $(MC_LIB)
89        cp $(OC_SRC)/bin/OptimicaCompiler.jar $(MC_LIB)
90        cp $(MC_SRC)/bin/util.jar $(MC_LIB)
91        case $(build) in \
92        *-cygwin*) \
93        cp $(MC_BUILD)/ifcasadi/ifcasadi.dll $(MC_LIB) ;; \
94        *-mingw*) \
95        cp $(MC_BUILD)/ifcasadi/ifcasadi.dll $(MC_LIB) ;; \
96        *) \
97        cp $(MC_BUILD)/ifcasadi/libifcasadi.so $(MC_LIB) ;; \
98        esac
99
100mc_modelica: ifcasadi
101        cd $(MC_SRC); $(ANT_OPTS) $(ANT)
102
103mc_optimica: ifcasadi
104        mkdir -p $(OC_SRC)/src/java-generated
105        cp -pr $(MC_SRC)/src/java-generated/ifcasadi $(OC_SRC)/src/java-generated
106        cd $(OC_SRC); $(ANT_OPTS) $(ANT)
107
108$(MC_SRC)/bin/ModelicaCompiler.jar: mc_modelica
109$(MC_SRC)/bin/util.jar:             mc_modelica
110$(MC_SRC)/bin/separateProcess.jar:  mc_modelica
111
112$(OC_SRC)/bin/OptimicaCompiler.jar: mc_optimica
113$(OC_SRC)/bin/util.jar:             mc_optimica
114$(OC_SRC)/bin/separateProcess.jar:  mc_optimica
115
116$(MC_BUILD)/modelicacasadi_wrapper/swig/modelicacasadi_wrapper.py: modelicacasadi_wrapper
117
118# Hook for using a specific Python installation
119PYTHON_LIB=
120PYTHON_INCLUDE=
121
122modelicacasadi_wrapper:
123        if [ "$(PYTHON_LIB)" ] && [ "$(PYTHON_INCLUDE)" ]; then \
124          CMAKE_EXTRA_ARGS="-DPYTHON_LIBRARY=$(PYTHON_LIB) -DPYTHON_INCLUDE_DIR=$(PYTHON_INCLUDE)"; \
125        else \
126          CMAKE_EXTRA_ARGS=""; \
127        fi; \
128        mkdir -p $(MC_BUILD)/modelicacasadi_wrapper; \
129        cd $(MC_BUILD)/modelicacasadi_wrapper; \
130        case $(build) in \
131        *-cygwin*) \
132        cmake $(MC_INTERFACE) -G "MSYS Makefiles" -DCMAKE_CXX_COMPILER_ARG1="-m32" -DCMAKE_CXX_FLAGS="-m32" $${CMAKE_EXTRA_ARGS} ;; \
133        *-mingw*) \
134        cmake $(MC_INTERFACE) -G "MSYS Makefiles" -DCMAKE_CXX_COMPILER_ARG1="-m32" -DCMAKE_CXX_FLAGS="-m32" $${CMAKE_EXTRA_ARGS} ;; \
135        *) \
136        cmake $(MC_INTERFACE) $${CMAKE_EXTRA_ARGS} ;; \
137        esac
138        cd $(MC_BUILD)/modelicacasadi_wrapper;  make modelicacasadi_wrapper
139
140
141 $(DESTDIR)$(prefix)/Python/modelicacasadi_transfer/__init__.py: install_modelicacasadi_transfer
142 $(DESTDIR)$(prefix)/Python/modelicacasadi_transfer/modelica_casadi_transfer_wrapper.py: install_modelicacasadi_transfer
143 
144 $(DESTDIR)$(prefix)/Python/modelicacasadi_wrapper/__init__.py: install_modelicacasadi_wrapper
145 
146 install_modelicacasadi_wrapper: $(MC_BUILD)/modelicacasadi_wrapper/swig/modelicacasadi_wrapper.py
147        mkdir -p $(DESTDIR)$(prefix)/Python/modelicacasadi_wrapper
148        cp $(MC_BUILD)/modelicacasadi_wrapper/swig/*modelicacasadi_wrapper* $(DESTDIR)$(prefix)/Python/modelicacasadi_wrapper
149        rm -f $(DESTDIR)$(prefix)/Python/modelicacasadi_wrapper/__init__.py
150        touch $(DESTDIR)$(prefix)/Python/modelicacasadi_wrapper/__init__.py
151        echo "from modelicacasadi_wrapper import *" >> $(DESTDIR)$(prefix)/Python/modelicacasadi_wrapper/__init__.py
152 
153 install_modelicacasadi_transfer: $(MC_INTERFACE)/python/modelica_casadi_transfer_wrapper.py
154        mkdir -p $(DESTDIR)$(prefix)/Python/modelicacasadi_transfer
155        rm -f $(DESTDIR)$(prefix)/Python/modelicacasadi_transfer/__init__.py
156        touch $(DESTDIR)$(prefix)/Python/modelicacasadi_transfer/__init__.py
157        echo "from modelica_casadi_transfer_wrapper import *" >> $(DESTDIR)$(prefix)/Python/modelicacasadi_transfer/__init__.py
158        cp $(MC_INTERFACE)/python/modelica_casadi_transfer_wrapper.py $(DESTDIR)$(prefix)/Python/modelicacasadi_transfer
159       
160build-python-packages:
161if WITH_SUNDIALS
162if WITH_SUPERLU
163        cd $(abs_top_srcdir)/external/Assimulo; \
164        case $(build) in \
165        *-cygwin*) \
166        python setup.py install --sundials-home=$(SUNDIALS_HOME) --superlu-home=$(SUPERLU_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) ;; \
167        *-mingw*) \
168        python setup.py install --sundials-home=$(SUNDIALS_HOME) --superlu-home=$(SUPERLU_HOME) --blas-home=$(abs_builddir)/blas_install/ --lapack-home=$(abs_builddir)/lapack_install/ --force-32bit="true" --no-msvcr="true" --extra-c-flags="-mincoming-stack-boundary=2" --prefix=$(assimulo_install_dir) ;; \
169        *) \
170        python setup.py install --sundials-home=$(SUNDIALS_HOME) --superlu-home=$(SUPERLU_HOME) --blas-home=$(abs_builddir)/blas_install/ --lapack-home=$(abs_builddir)/lapack_install/ --prefix=$(assimulo_install_dir) ;; \
171        esac
172endif
173endif
174if WITH_SUNDIALS
175if !WITH_SUPERLU
176        cd $(abs_top_srcdir)/external/Assimulo; \
177        case $(build) in \
178        *-cygwin*) \
179        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) ;; \
180        *-mingw*) \
181        python setup.py install --sundials-home=$(SUNDIALS_HOME) --blas-home=$(abs_builddir)/blas_install/ --lapack-home=$(abs_builddir)/lapack_install/ --force-32bit="true" --no-msvcr="true" --extra-c-flags="-mincoming-stack-boundary=2" --prefix=$(assimulo_install_dir) ;; \
182        *) \
183        python setup.py install --sundials-home=$(SUNDIALS_HOME) --blas-home=$(abs_builddir)/blas_install/ --lapack-home=$(abs_builddir)/lapack_install/ --prefix=$(assimulo_install_dir) ;; \
184        esac
185endif
186endif
187        cd $(abs_top_srcdir)/Python/src; \
188        python setup_pymodelica.py install --prefix=$(pymodelica_install_dir); \
189        rm -rf build
190
191        cd $(abs_top_srcdir)/external/PyFMI; \
192        case $(build) in \
193        *-cygwin*) \
194        python setup.py install --fmil-home=$(abs_builddir)/FMIL_install/ --force-32bit="true" --extra-c-flags="-mincoming-stack-boundary=2" --prefix=$(pyfmi_install_dir) ;; \
195        *-mingw*) \
196        python setup.py install --fmil-home=$(abs_builddir)/FMIL_install/ --force-32bit="true" --no-msvcr="true" --extra-c-flags="-mincoming-stack-boundary=2" --prefix=$(pyfmi_install_dir) ;; \
197        *) \
198        python setup.py install --fmil-home=$(abs_builddir)/FMIL_install/ --prefix=$(pyfmi_install_dir) ;; \
199        esac
200        rm -rf build
201
202        cd $(abs_top_srcdir)/Python/src; \
203        python setup_pyjmi.py install --prefix=$(pyjmi_install_dir); \
204        rm -rf build
205
206install-python-packages: build-python-packages
207        mkdir -p $(DESTDIR)$(prefix)/Python
208        cp $(abs_top_srcdir)/Python/src/startup.py $(DESTDIR)$(prefix)/
209        [ $(abs_top_srcdir) == $(DESTDIR)$(prefix) ] && echo "Installing in dist directory, don't copy LICENSE file" || cp $(abs_top_srcdir)/Python/LICENSE $(DESTDIR)$(prefix)/Python
210if WITH_SUNDIALS
211        for pkgdir in lib/python2.5 lib/python2.6 lib/python2.7 lib64/python2.5 lib64/python2.6 lib64/python2.7 Lib; do \
212        if [ -e $(assimulo_install_dir)/$${pkgdir}/site-packages/ ]; \
213        then \
214        cd $(assimulo_install_dir)/$${pkgdir}/site-packages/; \
215        find assimulo -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(DESTDIR)$(prefix)/Python; \
216        fi; \
217        done
218endif
219        for pkgdir in lib/python2.5 lib/python2.6 lib/python2.7 lib64/python2.5 lib64/python2.6 lib64/python2.7 Lib; do \
220        if [ -e $(pymodelica_install_dir)/$${pkgdir}/site-packages/ ]; \
221        then \
222        cd $(pymodelica_install_dir)/$${pkgdir}/site-packages/; \
223        find pymodelica -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(DESTDIR)$(prefix)/Python; \
224        fi; \
225        done
226        for pkgdir in lib/python2.5 lib/python2.6 lib/python2.7 lib64/python2.5 lib64/python2.6 lib64/python2.7 Lib; do \
227        if [ -e $(pyjmi_install_dir)/$${pkgdir}/site-packages/ ]; \
228        then \
229        cd $(pyjmi_install_dir)/$${pkgdir}/site-packages/; \
230        find pyjmi -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(DESTDIR)$(prefix)/Python; \
231        fi; \
232        done
233        for pkgdir in lib/python2.5 lib/python2.6 lib/python2.7 lib64/python2.5 lib64/python2.6 lib64/python2.7 Lib; do \
234        if [ -e $(pyfmi_install_dir)/$${pkgdir}/site-packages/ ]; \
235        then \
236        cd $(pyfmi_install_dir)/$${pkgdir}/site-packages/; \
237        find pyfmi -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(DESTDIR)$(prefix)/Python; \
238        fi; \
239        done
240        cd $(abs_top_srcdir)/Python/src/tests_jmodelica/; \
241        mkdir -p $(DESTDIR)$(prefix)/Python/tests_jmodelica; \
242        find . -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(DESTDIR)$(prefix)/Python/tests_jmodelica
243        rm -rf $(DESTDIR)$(prefix)/Python/tests_jmodelica/files/Modelica/Resources/src
244        rm -f $(DESTDIR)$(prefix)/Python/tests_jmodelica/files/Modelica/Resources/CMakeLists.txt
245        rm -f $(DESTDIR)$(prefix)/Python/tests_jmodelica/files/Modelica/Resources/Makefile.am
246        rm -f $(DESTDIR)$(prefix)/Python/tests_jmodelica/files/Modelica/Resources/Makefile.in
247        mkdir -p $(DESTDIR)$(prefix)/bin
248        [ -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
249        [ -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
250        chmod ugo+x $(DESTDIR)$(prefix)/bin/jm_*.sh
251
252# Hooks for extra build or install actions. Must be empty or the path of a shell script to execute.
253# Both scripts will get the source directory as the first argument and the install directory as the second.
254BUILD_EXTRA=
255INSTALL_EXTRA=
256INSTALL_EXTRA_CASADI=
257
258# Paths for Java build
259JAVA_BUILD_DIR=$(abs_builddir)/java
260COMPILER_DIR=$(abs_top_srcdir)/Compiler
261JAVA_MC_ANT_FILE=$(COMPILER_DIR)/ModelicaCompiler/build.xml
262JAVA_OC_ANT_FILE=$(COMPILER_DIR)/OptimicaCompiler/build.xml
263
264all-local: build-python-packages
265if HAVE_ANT
266        mkdir -p $(JAVA_BUILD_DIR)
267        cd $(JAVA_BUILD_DIR); \
268        $(ANT_OPTS) $(ANT) -f "$(JAVA_MC_ANT_FILE)" "-Dcompiler=$(COMPILER_DIR)"
269        cd $(JAVA_BUILD_DIR); \
270        $(ANT_OPTS) $(ANT) -f "$(JAVA_OC_ANT_FILE)" "-Dcompiler=$(COMPILER_DIR)"
271        java -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" org.jmodelica.modelica.compiler.ModelicaCompiler\$$OptionExporter "$(abs_builddir)/DefaultOptions.xml"
272endif
273        $(abs_top_srcdir)/get_version.sh $(abs_top_srcdir) https://svn.jmodelica.org > $(abs_builddir)/version.txt
274        if [ "$(BUILD_EXTRA)" ]; then exec "$(BUILD_EXTRA)" "$(abs_top_srcdir)" "$(DESTDIR)$(prefix)"; fi
275
276install-exec-local: install-python-packages
277if HAVE_ANT
278        cp $(JAVA_BUILD_DIR)/bin/ModelicaCompiler.jar $(DESTDIR)$(prefix)/lib/
279        cp $(JAVA_BUILD_DIR)/bin/util.jar $(DESTDIR)$(prefix)/lib/
280        cp $(JAVA_BUILD_DIR)/bin/OptimicaCompiler.jar $(DESTDIR)$(prefix)/lib/
281        cp $(JAVA_BUILD_DIR)/bin/separateProcess.jar $(DESTDIR)$(prefix)/lib/
282endif
283        [ $(abs_top_srcdir) == $(DESTDIR)$(prefix) ] && echo "Installing in dist directory, don't copy LICENSE file" || cp $(abs_top_srcdir)/LICENSE $(DESTDIR)$(prefix)/
284        cp $(abs_top_srcdir)/JMI/LICENSE_GPL $(DESTDIR)$(prefix)/lib/
285        cp $(abs_top_srcdir)/JMI/LICENSE_CPL $(DESTDIR)$(prefix)/lib/
286        cp $(abs_top_srcdir)/JMI/LICENSE_GPL $(DESTDIR)$(prefix)/include/
287        cp $(abs_top_srcdir)/JMI/LICENSE_CPL $(DESTDIR)$(prefix)/include/
288        mkdir -p $(DESTDIR)$(prefix)/Makefiles
289        cp $(abs_top_srcdir)/JMI/LICENSE_GPL $(DESTDIR)$(prefix)/Makefiles/LICENSE
290        case $(build) in \
291        *-cygwin*) \
292        cp $(abs_top_srcdir)/RuntimeLibrary/Makefiles/Makefile.windows $(DESTDIR)$(prefix)/Makefiles/Makefile ;; \
293        *-mingw*) \
294        cp $(abs_top_srcdir)/RuntimeLibrary/Makefiles/Makefile.windows $(DESTDIR)$(prefix)/Makefiles/MakeFile ;; \
295        *-apple*) \
296        cp $(abs_top_srcdir)/RuntimeLibrary/Makefiles/Makefile.macosx $(DESTDIR)$(prefix)/Makefiles/MakeFile ;; \
297        *) \
298        cp $(abs_top_srcdir)/RuntimeLibrary/Makefiles/Makefile.linux $(DESTDIR)$(prefix)/Makefiles/MakeFile ;; \
299        esac
300
301if COPY_PTHREADS_LIB
302        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/pthreads/lib
303        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/pthreads/include
304        cp $(abs_top_srcdir)/ThirdParty/pthreads/lib/win32/libpthreadGC2-2-9-1.a $(DESTDIR)$(prefix)/ThirdParty/pthreads/lib
305        cp $(abs_top_srcdir)/ThirdParty/pthreads/include/*.h $(DESTDIR)$(prefix)/ThirdParty/pthreads/include
306endif
307
308        cp $(abs_builddir)/DefaultOptions.xml $(DESTDIR)$(prefix)/DefaultOptions.xml
309        mkdir -p $(DESTDIR)$(prefix)/ThirdParty
310        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/Beaver
311        cp $(abs_top_srcdir)/ThirdParty/Beaver/beaver-0.9.6.1/LICENSE $(DESTDIR)$(prefix)/ThirdParty/Beaver/
312        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/Beaver/lib
313        cp $(abs_top_srcdir)/ThirdParty/Beaver/beaver-0.9.6.1/lib/beaver-rt.jar $(DESTDIR)$(prefix)/ThirdParty/Beaver/lib/
314        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/Sundials
315        cp -r $(SUNDIALS_HOME)/* $(DESTDIR)$(prefix)/ThirdParty/Sundials
316        cp $(abs_top_srcdir)/ThirdParty/Sundials/sundials-2.5.0/LICENSE $(DESTDIR)$(prefix)/ThirdParty/Sundials
317if JM_WIN64
318        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/Sundials/lib64
319        cp -r $(SUNDIALS_HOME)64/lib/* $(DESTDIR)$(prefix)/ThirdParty/Sundials/lib64
320endif
321        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/Minpack
322        cp -r $(MINPACK_HOME)/* $(DESTDIR)$(prefix)/ThirdParty/Minpack
323        cp $(abs_top_srcdir)/ThirdParty/Minpack/cminpack-1.3.2/CopyrightMINPACK.txt $(DESTDIR)$(prefix)/ThirdParty/Minpack
324        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/CppAD
325        cp $(CPPAD_HOME)/COPYING $(DESTDIR)$(prefix)/ThirdParty/CppAD
326        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/CppAD/cppad     
327        cp $(CPPAD_HOME)/cppad/*.h $(DESTDIR)$(prefix)/ThirdParty/CppAD/cppad
328        cp $(CPPAD_HOME)/cppad/*.hpp $(DESTDIR)$(prefix)/ThirdParty/CppAD/cppad
329        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/CppAD/cppad/local       
330        cp $(CPPAD_HOME)/cppad/local/*.hpp $(DESTDIR)$(prefix)/ThirdParty/CppAD/cppad/local
331        if [ $(abs_top_srcdir) == $(DESTDIR)$(prefix) ]; then \
332          echo "Installing in dist directory, don't copy MSL"; \
333        else \
334          mkdir -p "$(DESTDIR)$(prefix)/ThirdParty/MSL/Modelica"; \
335          mkdir -p "$(DESTDIR)$(prefix)/ThirdParty/MSL/ModelicaServices"; \
336          cd "$(DESTDIR)$(prefix)/ThirdParty/MSL"; \
337          find . -depth -print0 | while read -d $$'\0' -r f ; do if [ ! -e "$(abs_top_srcdir)/ThirdParty/MSL/$${f}" ]; then rm -rf "$${f}"; fi; done; \
338          cd "$(abs_top_srcdir)/ThirdParty/MSL/Modelica"; \
339          find * -type f |grep -v /.svn | grep -v ~ |tar c -T - -f - | tar x -C "$(DESTDIR)$(prefix)/ThirdParty/MSL/Modelica"; \
340          cd "$(abs_top_srcdir)/ThirdParty/MSL/ModelicaServices"; \
341          find * -type f |grep -v /.svn | grep -v ~ |tar c -T - -f - | tar x -C "$(DESTDIR)$(prefix)/ThirdParty/MSL/ModelicaServices"; \
342          cd "$(abs_top_srcdir)/ThirdParty/MSL"; \
343          $(CP) Complex.mo "$(DESTDIR)$(prefix)/ThirdParty/MSL"; \
344        fi
345        mkdir -p $(DESTDIR)$(prefix)/CodeGenTemplates
346        mkdir -p $(DESTDIR)$(prefix)/CodeGenTemplates/FMIBase
347        cp $(abs_top_srcdir)/JMI/LICENSE_GPL $(DESTDIR)$(prefix)/CodeGenTemplates/LICENSE
348        cp -r $(abs_top_srcdir)/Compiler/ModelicaCBackEnd/templates/*.c $(DESTDIR)$(prefix)/CodeGenTemplates
349        cp -r $(abs_top_srcdir)/Compiler/ModelicaCBackEnd/templates/FMIBase/*.c $(DESTDIR)$(prefix)/CodeGenTemplates/FMIBase
350        cp -r $(abs_top_srcdir)/Compiler/ModelicaCBackEnd/templates/FMIBase/*.h $(DESTDIR)$(prefix)/CodeGenTemplates/FMIBase
351        cp  $(abs_top_srcdir)/Compiler/OptimicaCBackEnd/templates/jmi_optimica_template.c $(DESTDIR)$(prefix)/CodeGenTemplates
352        cp  $(abs_top_srcdir)/Compiler/ModelicaFMUXBackEnd/templates/*.tpl $(DESTDIR)$(prefix)/CodeGenTemplates
353        mkdir -p $(DESTDIR)$(prefix)/XML
354        [ $(abs_top_srcdir) == $(DESTDIR)$(prefix) ] && echo "Installing in dist directory, don't copy XML schemas"  || cp  $(abs_top_srcdir)/XML/*.xsd $(DESTDIR)$(prefix)/XML
355        [ $(abs_top_srcdir) == $(DESTDIR)$(prefix) ] && echo "Installing in dist directory, don't copy XML LICENSE"  || cp  $(abs_top_srcdir)/XML/LICENSE $(DESTDIR)$(prefix)/XML
356        cp  $(abs_builddir)/version.txt $(DESTDIR)$(prefix)
357        cp jm_tests $(DESTDIR)$(prefix)/jm_tests
358        chmod ugo+x $(DESTDIR)$(prefix)/jm_tests
359        if [ "$(INSTALL_EXTRA)" ]; then exec "$(INSTALL_EXTRA)" "$(abs_top_srcdir)" "$(DESTDIR)$(prefix)"; fi
360
361bindistdir: install
362        rm -rf $(bindistdir)
363        mkdir -p $(bindistdir)
364        cp $(DESTDIR)$(prefix)/LICENSE $(bindistdir)
365        cp $(DESTDIR)$(prefix)/startup.py $(bindistdir)
366        cp $(DESTDIR)$(prefix)/version.txt $(bindistdir)
367        cp $(DESTDIR)$(prefix)/DefaultOptions.xml $(bindistdir)
368        cp -r $(DESTDIR)$(prefix)/CodeGenTemplates $(bindistdir)
369        cp -r $(DESTDIR)$(prefix)/Makefiles $(bindistdir)
370        cp -r $(DESTDIR)$(prefix)/Python $(bindistdir)
371        cp -r $(DESTDIR)$(prefix)/ThirdParty $(bindistdir)
372        cp -r $(DESTDIR)$(prefix)/XML $(bindistdir)
373        cp -r $(DESTDIR)$(prefix)/include $(bindistdir)
374        cp -r $(DESTDIR)$(prefix)/lib $(bindistdir)
375if COMPILE_WITH_IPOPT   
376        mkdir -p $(bindistdir)/ThirdParty/Ipopt
377# Copy files
378        cd $(IPOPT_HOME); find * -type f |grep -v /.svn | grep -v ~ |tar c -T - -f - | tar x -C $(abs_builddir)/$(bindistdir)/ThirdParty/Ipopt
379# Copy symbolic links
380        cd $(IPOPT_HOME); find * -type l |grep -v /.svn | grep -v ~ |tar c -T - -f - | tar x -C $(abs_builddir)/$(bindistdir)/ThirdParty/Ipopt
381endif
382
383if WITH_MINGW   
384        mkdir -p $(bindistdir)/ThirdParty/MinGW
385# Copy files
386        cd $(MINGW_HOME); find * -type f |grep -v /.svn | grep -v ~ |tar c -T - -f - | tar x -C $(abs_builddir)/$(bindistdir)/ThirdParty/MinGW
387# Copy symbolic links
388        cd $(MINGW_HOME); find * -type l |grep -v /.svn | grep -v ~ |tar c -T - -f - | tar x -C $(abs_builddir)/$(bindistdir)/ThirdParty/MinGW
389endif
390
391bindist: bindistdir
392        tar -cf $(bindistdir).tar $(bindistdir)
393        gzip -c $(bindistdir).tar > $(bindistdir).tar.gz
394        rm -rf $(bindistdir)
395        rm -rf $(bindistdir).tar
396
397test: install
398        $(prefix)/jm_tests -i
399
400clean-local: clean-frontends clean-python-packages clean-casadi-interface
401
402clean-casadi-interface:
403        rm -rf $(MC_BUILD)
404#       rm -rf $(DESTDIR)$(prefix)/Python/casadi
405#       rm -rf $(DESTDIR)$(prefix)/Python/modelicacasadi_transfer
406if HAVE_ANT
407        cd $(abs_top_srcdir)/Compiler/ModelicaCompilerCasADi; \
408        $(ANT_OPTS) $(ANT) clean ; rm -rf $(MC_SRC)/src/cpp-generated $(MC_SRC)/src/java-generated/ifcasadi
409        cd $(abs_top_srcdir)/Compiler/OptimicaCompilerCasADi; \
410        $(ANT_OPTS) $(ANT) clean ; rm -rf $(OC_SRC)/src/cpp-generated $(OC_SRC)/src/java-generated/ifcasadi
411endif
412       
413
414clean-python-packages:
415if WITH_SUNDIALS
416        cd $(abs_top_srcdir)/external/Assimulo; \
417        python setup.py clean --all --sundials-home=$(SUNDIALS_HOME)
418        rm -rf $(assimulo_install_dir) || echo  Could not remove $(assimulo_install_dir)
419endif
420        -cd $(abs_top_srcdir)/Python/src; \
421        python setup_pymodelica.py clean --all
422        -rm -rf $(pymodelica_install_dir) || echo  Could not remove $(pymodelica_install_dir)
423        -cd $(abs_top_srcdir)/external/PyFMI; \
424        python setup.py  clean --all
425        -rm -rf $(pyfmi_install_dir) || echo  Could not remove $(pyfmi_install_dir)
426        -cd $(abs_top_srcdir)/Python/src; \
427        python setup_pyjmi.py clean --all
428        -rm -rf $(pyjmi_install_dir)|| echo  Could not remove $(pyjmi_install_dir)
429
430clean-frontends:
431if HAVE_ANT
432        rm -rf $(JAVA_BUILD_DIR)
433endif
434
435docs:
436        cd $(abs_top_srcdir); doxygen doc/JMI/jmi_doxydoc.conf
437        cd $(abs_top_srcdir); doxygen doc/ModelicaCompiler/modelica_compiler_doxydoc.conf
438        cd $(abs_top_srcdir); doxygen doc/OptimicaCompiler/optimica_compiler_doxydoc.conf
439        make -C $(abs_top_srcdir)/doc/PyJMI html
440
441docbook-docs:
442        cd docbook/UsersGuide; $(MAKE) all
443
444
445.PHONY: modelicacasadi_wrapper ifcasadi install_modelicacasadi_transfer install_modelicacasadi_wrapper
Note: See TracBrowser for help on using the repository browser.