source: trunk/Makefile.am @ 13800

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

#5844 Merge to trunk. Moved casadi related make targets to its own file.

File size: 22.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
43assimulo_src_dir=$(abs_top_srcdir)/external/Assimulo
44
45bindistdir=JModelica.org-$(VERSION)-bin
46
47include MakefileCasadi.am
48
49if NUMPY_NO_MSVCR
50NUMPY_NO_MSVCR_ARG=--no-msvcr="true"
51else
52NUMPY_NO_MSVCR_ARG=
53endif
54
55
56build-python-packages:
57if PYTHON_ENABLED
58if WITH_OPENMP
59        mkdir -p $(assimulo_build_dir); \
60        cd $(assimulo_src_dir)/..; \
61        find Assimulo -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(assimulo_build_dir); \
62        cd $(assimulo_build_dir)/Assimulo; \
63        case $(build) in \
64        *-cygwin*) \
65        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) ;; \
66        *-mingw*) \
67        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) ;; \
68        *) \
69        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) ;; \
70        esac
71if JM_WIN64
72if WITH_PYTHON64
73        mkdir -p $(assimulo_build_dir64); \
74        cd $(assimulo_src_dir)/..; \
75        find Assimulo -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(assimulo_build_dir64); \
76        cd $(assimulo_build_dir)/Assimulo; \
77        export PATH=$(PYTHON64_HOME):$(PYTHON64_HOME)/Scripts:$(PYTHON64_HOME)/Lib:"${PATH}"; \
78        export PYTHONHOME=$(PYTHON64_HOME); \
79        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); \
80        export PATH="$(ORIG_PATH)"; \
81        export PYTHONHOME=$(ORIG_PYTHON_HOME)
82endif
83endif
84endif
85if !WITH_OPENMP
86        mkdir -p $(assimulo_build_dir); \
87        cd $(assimulo_src_dir)/..; \
88        find Assimulo -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(assimulo_build_dir); \
89        cd $(assimulo_build_dir)/Assimulo; \
90        case $(build) in \
91        *-cygwin*) \
92        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) ;; \
93        *-mingw*) \
94        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) ;; \
95        *) \
96        python setup.py install --sundials-home=$(SUNDIALS_HOME) --blas-home=$(abs_builddir)/blas_install/ --lapack-home=$(abs_builddir)/lapack_install/ --prefix=$(assimulo_install_dir) ;; \
97        esac
98if JM_WIN64
99if WITH_PYTHON64
100        mkdir -p $(assimulo_build_dir64); \
101        cd $(assimulo_src_dir)/..; \
102        find Assimulo -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(assimulo_build_dir64); \
103        cd $(assimulo_build_dir64)/Assimulo; \
104        export PATH=$(PYTHON64_HOME):$(PYTHON64_HOME)/Scripts:$(PYTHON64_HOME)/Lib:"${PATH}"; \
105        export PYTHONHOME=$(PYTHON64_HOME); \
106        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) ; \
107        export PATH="$(ORIG_PATH)"; \
108        export PYTHONHOME=$(ORIG_PYTHON_HOME)
109endif
110endif
111endif
112        cd $(abs_top_srcdir)/Python/src; \
113        python setup_pymodelica.py install --prefix=$(pymodelica_install_dir); \
114        rm -rf build
115if JM_WIN64
116if WITH_PYTHON64
117        cd $(abs_top_srcdir)/Python/src; \
118        export PATH=$(PYTHON64_HOME):$(PYTHON64_HOME)/Scripts:$(PYTHON64_HOME)/Lib:"${PATH}"; \
119        export PYTHONHOME=$(PYTHON64_HOME); \
120        python setup_pymodelica.py install --prefix=$(pymodelica_install_dir64); \
121        export PATH="$(ORIG_PATH)"; \
122        export PYTHONHOME=$(ORIG_PYTHON_HOME); \
123        rm -rf build
124endif
125endif
126        mkdir -p $(pyfmi_build_dir); \
127        cd $(abs_top_srcdir)/external; \
128        find PyFMI -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(pyfmi_build_dir); \
129        cd $(pyfmi_build_dir)/PyFMI; \
130        case $(build) in \
131        *-cygwin*) \
132        python setup.py install --fmil-home=$(abs_builddir)/FMIL_install/ --force-32bit="true" --extra-c-flags="-mincoming-stack-boundary=2" --prefix=$(pyfmi_install_dir) ;; \
133        *-mingw*) \
134        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) ;; \
135        *) \
136        python setup.py install --fmil-home=$(abs_builddir)/FMIL_install/ --prefix=$(pyfmi_install_dir) ;; \
137        esac
138        rm -rf build
139if JM_WIN64
140if WITH_PYTHON64
141        mkdir -p $(pyfmi_build_dir64); \
142        cd $(abs_top_srcdir)/external; \
143        find PyFMI -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(pyfmi_build_dir64); \
144        cd $(pyfmi_build_dir64)/PyFMI; \
145        export PATH=$(PYTHON64_HOME):$(PYTHON64_HOME)/Scripts:$(PYTHON64_HOME)/Lib:"${PATH}"; \
146        export PYTHONHOME=$(PYTHON64_HOME); \
147        python setup.py install --fmil-home=$(abs_builddir)/FMIL_install64/ $(NUMPY_NO_MSVCR_ARG) --prefix=$(pyfmi_install_dir64); \
148        export PATH="$(ORIG_PATH)"; \
149        export PYTHONHOME=$(ORIG_PYTHON_HOME); \
150        rm -rf build
151endif
152endif
153        cd $(abs_top_srcdir)/Python/src; \
154        python setup_pyjmi.py install --prefix=$(pyjmi_install_dir); \
155        rm -rf build
156if JM_WIN64
157if WITH_PYTHON64
158        cd $(abs_top_srcdir)/Python/src; \
159        export PATH=$(PYTHON64_HOME):$(PYTHON64_HOME)/Scripts:$(PYTHON64_HOME)/Lib:"${PATH}"; \
160        export PYTHONHOME=$(PYTHON64_HOME); \
161        python setup_pyjmi.py install --prefix=$(pyjmi_install_dir64); \
162        export PATH="$(ORIG_PATH)"; \
163        export PYTHONHOME=$(ORIG_PYTHON_HOME); \
164        rm -rf build
165endif
166endif
167endif
168
169install-python-tests:
170if PYTHON_ENABLED
171        chmod ugo+x jm_tests
172        cp -p jm_tests $(DESTDIR)$(prefix)/jm_tests
173       
174        cd $(abs_top_srcdir)/Python/src/tests_jmodelica/; \
175        mkdir -p $(DESTDIR)$(prefix)/Python/tests_jmodelica; \
176        find . -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(DESTDIR)$(prefix)/Python/tests_jmodelica
177        rm -rf $(DESTDIR)$(prefix)/Python/tests_jmodelica/files/Modelica/Resources/src
178        rm -f $(DESTDIR)$(prefix)/Python/tests_jmodelica/files/Modelica/Resources/CMakeLists.txt
179        rm -f $(DESTDIR)$(prefix)/Python/tests_jmodelica/files/Modelica/Resources/Makefile.am
180        rm -f $(DESTDIR)$(prefix)/Python/tests_jmodelica/files/Modelica/Resources/Makefile.in
181if JM_WIN64
182if WITH_PYTHON64
183        cd $(abs_top_srcdir)/Python/src/tests_jmodelica/; \
184        mkdir -p $(DESTDIR)$(prefix)/Python_64/tests_jmodelica; \
185        find . -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(DESTDIR)$(prefix)/Python_64/tests_jmodelica
186        rm -rf $(DESTDIR)$(prefix)/Python_64/tests_jmodelica/files/Modelica/Resources/src
187        rm -f $(DESTDIR)$(prefix)/Python_64/tests_jmodelica/files/Modelica/Resources/CMakeLists.txt
188        rm -f $(DESTDIR)$(prefix)/Python_64/tests_jmodelica/files/Modelica/Resources/Makefile.am
189        rm -f $(DESTDIR)$(prefix)/Python_64/tests_jmodelica/files/Modelica/Resources/Makefile.in
190endif
191endif
192endif
193
194install-python-packages: build-python-packages install-python-tests
195if PYTHON_ENABLED
196        mkdir -p $(DESTDIR)$(prefix)/Python
197        cp $(abs_top_srcdir)/Python/src/startup.py $(DESTDIR)$(prefix)/
198        cp Python/src/required_defaults.py $(DESTDIR)$(prefix)/Python/
199        [ $(abs_top_srcdir) == $(DESTDIR)$(prefix) ] && echo "Installing in dist directory, don't copy LICENSE file" || cp $(abs_top_srcdir)/Python/LICENSE $(DESTDIR)$(prefix)/Python
200if JM_WIN64
201if WITH_PYTHON64
202        mkdir -p $(DESTDIR)$(prefix)/Python_64
203        cp Python/src/required_defaults.py $(DESTDIR)$(prefix)/Python_64/
204        [ $(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
205endif
206endif
207        for pkgdir in lib/python2.5 lib/python2.6 lib/python2.7 lib64/python2.5 lib64/python2.6 lib64/python2.7 Lib; do \
208        if [ -e $(assimulo_install_dir)/$${pkgdir}/site-packages/ ]; \
209        then \
210        cd $(assimulo_install_dir)/$${pkgdir}/site-packages/; \
211        find assimulo -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(DESTDIR)$(prefix)/Python; \
212        fi; \
213        done
214        for pkgdir in lib/python2.5 lib/python2.6 lib/python2.7 lib64/python2.5 lib64/python2.6 lib64/python2.7 Lib; do \
215        if [ -e $(pymodelica_install_dir)/$${pkgdir}/site-packages/ ]; \
216        then \
217        cd $(pymodelica_install_dir)/$${pkgdir}/site-packages/; \
218        find pymodelica -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(DESTDIR)$(prefix)/Python; \
219        fi; \
220        done
221        for pkgdir in lib/python2.5 lib/python2.6 lib/python2.7 lib64/python2.5 lib64/python2.6 lib64/python2.7 Lib; do \
222        if [ -e $(pyjmi_install_dir)/$${pkgdir}/site-packages/ ]; \
223        then \
224        cd $(pyjmi_install_dir)/$${pkgdir}/site-packages/; \
225        find pyjmi -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(DESTDIR)$(prefix)/Python; \
226        fi; \
227        done
228        for pkgdir in lib/python2.5 lib/python2.6 lib/python2.7 lib64/python2.5 lib64/python2.6 lib64/python2.7 Lib; do \
229        if [ -e $(pyfmi_install_dir)/$${pkgdir}/site-packages/ ]; \
230        then \
231        cd $(pyfmi_install_dir)/$${pkgdir}/site-packages/; \
232        find pyfmi -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(DESTDIR)$(prefix)/Python; \
233        fi; \
234        done
235if JM_WIN64
236        for pkgdir in lib/python2.5 lib/python2.6 lib/python2.7 lib64/python2.5 lib64/python2.6 lib64/python2.7 Lib; do \
237        if [ -e $(assimulo_install_dir64)/$${pkgdir}/site-packages/ ]; \
238        then \
239        cd $(assimulo_install_dir64)/$${pkgdir}/site-packages/; \
240        find assimulo -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(DESTDIR)$(prefix)/Python_64; \
241        fi; \
242        done
243        for pkgdir in lib/python2.5 lib/python2.6 lib/python2.7 lib64/python2.5 lib64/python2.6 lib64/python2.7 Lib; do \
244        if [ -e $(pymodelica_install_dir64)/$${pkgdir}/site-packages/ ]; \
245        then \
246        cd $(pymodelica_install_dir64)/$${pkgdir}/site-packages/; \
247        find pymodelica -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(DESTDIR)$(prefix)/Python_64; \
248        fi; \
249        done
250        for pkgdir in lib/python2.5 lib/python2.6 lib/python2.7 lib64/python2.5 lib64/python2.6 lib64/python2.7 Lib; do \
251        if [ -e $(pyjmi_install_dir64)/$${pkgdir}/site-packages/ ]; \
252        then \
253        cd $(pyjmi_install_dir64)/$${pkgdir}/site-packages/; \
254        find pyjmi -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(DESTDIR)$(prefix)/Python_64; \
255        fi; \
256        done
257        for pkgdir in lib/python2.5 lib/python2.6 lib/python2.7 lib64/python2.5 lib64/python2.6 lib64/python2.7 Lib; do \
258        if [ -e $(pyfmi_install_dir64)/$${pkgdir}/site-packages/ ]; \
259        then \
260        cd $(pyfmi_install_dir64)/$${pkgdir}/site-packages/; \
261        find pyfmi -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(DESTDIR)$(prefix)/Python_64; \
262        fi; \
263        done
264endif
265        mkdir -p $(DESTDIR)$(prefix)/bin
266        [ -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
267        [ -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
268        chmod ugo+x $(DESTDIR)$(prefix)/bin/jm_*.sh
269endif
270       
271       
272# Hooks for extra build or install actions. Must be empty or the path of a shell script to execute.
273# Both scripts will get the source directory as the first argument and the install directory as the second.
274BUILD_EXTRA=
275INSTALL_EXTRA=
276INSTALL_EXTRA_CASADI=
277
278# Paths for Java build
279JAVA_BUILD_DIR=$(abs_builddir)/java
280COMPILER_DIR=$(abs_top_srcdir)/Compiler
281JAVA_MC_ANT_FILE=$(COMPILER_DIR)/ModelicaCompiler/build.xml
282JAVA_OC_ANT_FILE=$(COMPILER_DIR)/OptimicaCompiler/build.xml
283JAVA_CASADI_BASE_DIR=$(COMPILER_DIR)
284JAVA_CASADI_BUILD_DIR=$(abs_builddir)
285JAVA_MC_CASADI_ANT_FILE=$(COMPILER_DIR)/ModelicaCompilerCasADi/build.xml
286JAVA_OC_CASADI_ANT_FILE=$(COMPILER_DIR)/OptimicaCompilerCasADi/build.xml
287
288all-local: build-python-packages build-compiler $(abs_builddir)/version.txt build-extra
289
290$(abs_builddir)/version.txt: TODO-always-trigger
291        $(abs_top_srcdir)/get_version.sh $(abs_top_srcdir) https://svn.jmodelica.org > $(@)
292
293build-extra: TODO-always-trigger
294        if [ "$(BUILD_EXTRA)" ]; then exec "$(BUILD_EXTRA)" "$(abs_top_srcdir)" "$(DESTDIR)$(prefix)"; fi
295
296install-exec-local: install-python-packages install-compiler install-modules
297        [ $(abs_top_srcdir) == $(DESTDIR)$(prefix) ] && echo "Installing in dist directory, don't copy LICENSE file" || cp $(abs_top_srcdir)/LICENSE $(DESTDIR)$(prefix)/
298        cp $(abs_top_srcdir)/RuntimeLibrary/LICENSE_GPL $(DESTDIR)$(prefix)/lib/
299        cp $(abs_top_srcdir)/RuntimeLibrary/LICENSE_CPL $(DESTDIR)$(prefix)/lib/
300        cp $(abs_top_srcdir)/RuntimeLibrary/LICENSE_GPL $(DESTDIR)$(prefix)/include/
301        cp $(abs_top_srcdir)/RuntimeLibrary/LICENSE_CPL $(DESTDIR)$(prefix)/include/
302        mkdir -p $(DESTDIR)$(prefix)/Makefiles
303        cp $(abs_top_srcdir)/RuntimeLibrary/LICENSE_GPL $(DESTDIR)$(prefix)/Makefiles/LICENSE
304        case $(build) in \
305        *-cygwin*|*-mingw*) \
306        cp $(abs_top_srcdir)/RuntimeLibrary/Makefiles/Makefile.windows $(DESTDIR)$(prefix)/Makefiles/MakeFile && \
307        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/winpthreads/lib/winpthreads && \
308        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/winpthreads/include && \
309        cp $(abs_builddir)/winpthreads_build/COPYING $(DESTDIR)$(prefix)/ThirdParty/winpthreads && \
310        cp $(abs_builddir)/winpthreads_build/.libs/libwinpthread.a $(DESTDIR)$(prefix)/ThirdParty/winpthreads/lib/winpthreads && \
311        cp $(abs_builddir)/winpthreads_build/include/*.h $(DESTDIR)$(prefix)/ThirdParty/winpthreads/include ;; \
312        *-apple*) \
313        cp $(abs_top_srcdir)/RuntimeLibrary/Makefiles/Makefile.macosx $(DESTDIR)$(prefix)/Makefiles/MakeFile ;; \
314        *) \
315        cp $(abs_top_srcdir)/RuntimeLibrary/Makefiles/Makefile.linux $(DESTDIR)$(prefix)/Makefiles/MakeFile ;; \
316        esac
317
318        mkdir -p $(DESTDIR)$(prefix)/ThirdParty
319        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/Sundials
320        cp -r $(SUNDIALS_HOME)/* $(DESTDIR)$(prefix)/ThirdParty/Sundials
321        cp $(abs_top_srcdir)/ThirdParty/Sundials/sundials-2.7.0/LICENSE $(DESTDIR)$(prefix)/ThirdParty/Sundials
322if JM_WIN64
323        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/Sundials/lib64
324        cp -r $(SUNDIALS_HOME)64/lib/* $(DESTDIR)$(prefix)/ThirdParty/Sundials/lib64
325        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/winpthreads/lib/winpthreads64
326        cp $(abs_builddir)/winpthreads_build64/.libs/libwinpthread.a $(DESTDIR)$(prefix)/ThirdParty/winpthreads/lib/winpthreads64
327endif
328        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/Minpack
329        cp -r $(MINPACK_HOME)/* $(DESTDIR)$(prefix)/ThirdParty/Minpack
330        cp $(abs_top_srcdir)/ThirdParty/Minpack/cminpack-1.3.2/CopyrightMINPACK.txt $(DESTDIR)$(prefix)/ThirdParty/Minpack
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)/RuntimeLibrary/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/ModelicaFMUXBackEnd/templates/*.tpl $(DESTDIR)$(prefix)/CodeGenTemplates
352        mkdir -p $(DESTDIR)$(prefix)/XML
353        [ $(abs_top_srcdir) == $(DESTDIR)$(prefix) ] && echo "Installing in dist directory, don't copy XML schemas"  || cp  $(abs_top_srcdir)/XML/*.xsd $(DESTDIR)$(prefix)/XML
354        [ $(abs_top_srcdir) == $(DESTDIR)$(prefix) ] && echo "Installing in dist directory, don't copy XML LICENSE"  || cp  $(abs_top_srcdir)/XML/LICENSE $(DESTDIR)$(prefix)/XML
355        cp  $(abs_builddir)/version.txt $(DESTDIR)$(prefix)
356        if [ "$(INSTALL_EXTRA)" ]; then exec "$(INSTALL_EXTRA)" "$(abs_top_srcdir)" "$(DESTDIR)$(prefix)"; fi
357
358ant_output_jars= \
359        $(JAVA_BUILD_DIR)/bin/ModelicaCompiler.jar \
360        $(JAVA_BUILD_DIR)/bin/util.jar \
361        $(JAVA_BUILD_DIR)/bin/OptimicaCompiler.jar \
362        $(JAVA_BUILD_DIR)/bin/separateProcess.jar
363
364ant_output_options=$(JAVA_BUILD_DIR)/src/build/DefaultOptions.xml
365
366install-compiler: $(ant_output_jars) $(ant_output_options)
367if HAVE_ANT
368        mkdir -p $(DESTDIR)$(prefix)/lib/
369        install -t $(DESTDIR)$(prefix)/lib/ $(ant_output_jars)
370        install -t $(DESTDIR)$(prefix)/ $(ant_output_options)
371endif
372
373$(ant_output_jars) $(ant_output_options): build-compiler
374
375build-compiler: TODO-always-trigger
376if HAVE_ANT
377        mkdir -p $(JAVA_BUILD_DIR)
378        cd $(JAVA_BUILD_DIR); \
379        $(ANT_OPTS) $(ANT) -f "$(JAVA_MC_ANT_FILE)" "-Dcompiler=$(COMPILER_DIR)" "-Dtarget=$(JAVA_BUILD_DIR)"
380        cd $(JAVA_BUILD_DIR); \
381        $(ANT_OPTS) $(ANT) -f "$(JAVA_OC_ANT_FILE)" "-Dcompiler=$(COMPILER_DIR)" "-Dtarget=$(JAVA_BUILD_DIR)"
382endif
383
384# Dummy target used to always trigger rebuilds. Used to enable references to
385# outputs from phony targets as real targets. For example ant output.
386TODO-always-trigger: ;
387
388install-modules: install-modules-ModelicaFrontEnd
389
390BEAVER_INSTALL_DIR = $(DESTDIR)$(prefix)/ThirdParty/Beaver
391BEAVER_SOURCE = $(abs_top_srcdir)/Compiler/ModelicaFrontEnd/ThirdParty/Beaver
392
393install-modules-ModelicaFrontEnd: $(BEAVER_INSTALL_DIR)/LICENSE $(BEAVER_INSTALL_DIR)/lib/beaver-rt.jar
394
395$(BEAVER_INSTALL_DIR)/%: $(BEAVER_SOURCE)/%
396        install -D $(<) $(@)
397
398bindistdir: install
399        rm -rf $(bindistdir)
400        mkdir -p $(bindistdir)
401        cp $(DESTDIR)$(prefix)/LICENSE $(bindistdir)
402        cp $(DESTDIR)$(prefix)/startup.py $(bindistdir)
403        cp $(DESTDIR)$(prefix)/version.txt $(bindistdir)
404        cp $(DESTDIR)$(prefix)/DefaultOptions.xml $(bindistdir)
405        cp -r $(DESTDIR)$(prefix)/CodeGenTemplates $(bindistdir)
406        cp -r $(DESTDIR)$(prefix)/Makefiles $(bindistdir)
407        cp -r $(DESTDIR)$(prefix)/Python $(bindistdir)
408        cp -r $(DESTDIR)$(prefix)/ThirdParty $(bindistdir)
409        cp -r $(DESTDIR)$(prefix)/XML $(bindistdir)
410        cp -r $(DESTDIR)$(prefix)/include $(bindistdir)
411        cp -r $(DESTDIR)$(prefix)/lib $(bindistdir)
412if COMPILE_WITH_IPOPT   
413        mkdir -p $(bindistdir)/ThirdParty/Ipopt
414# Copy files
415        cd $(IPOPT_HOME); find * -type f |grep -v /.svn | grep -v ~ |tar c -T - -f - | tar x -C $(abs_builddir)/$(bindistdir)/ThirdParty/Ipopt
416# Copy symbolic links
417        cd $(IPOPT_HOME); find * -type l |grep -v /.svn | grep -v ~ |tar c -T - -f - | tar x -C $(abs_builddir)/$(bindistdir)/ThirdParty/Ipopt
418endif
419
420if WITH_MINGW   
421        mkdir -p $(bindistdir)/ThirdParty/MinGW
422# Copy files
423        cd $(MINGW_HOME); find * -type f |grep -v /.svn | grep -v ~ |tar c -T - -f - | tar x -C $(abs_builddir)/$(bindistdir)/ThirdParty/MinGW
424# Copy symbolic links
425        cd $(MINGW_HOME); find * -type l |grep -v /.svn | grep -v ~ |tar c -T - -f - | tar x -C $(abs_builddir)/$(bindistdir)/ThirdParty/MinGW
426endif
427
428bindist: bindistdir
429        tar -cf $(bindistdir).tar $(bindistdir)
430        gzip -c $(bindistdir).tar > $(bindistdir).tar.gz
431        rm -rf $(bindistdir)
432        rm -rf $(bindistdir).tar
433
434test: install
435        $(prefix)/jm_tests -i
436
437clean-local: clean-frontends clean-python-packages clean-casadi-interface
438       
439clean-python-packages:
440if PYTHON_ENABLED
441        if [ -d $(assimulo_build_dir)/Assimulo ]; then \
442                cd $(assimulo_build_dir)/Assimulo; \
443                python setup.py clean --all --sundials-home=$(SUNDIALS_HOME); \
444                cd $(abs_builddir); \
445        fi;
446        rm -rf $(assimulo_build_dir) || echo  Could not remove $(assimulo_build_dir)
447        rm -rf $(assimulo_install_dir) || echo  Could not remove $(assimulo_install_dir)
448        -cd $(abs_top_srcdir)/Python/src; \
449        python setup_pymodelica.py clean --all
450        -rm -rf $(pymodelica_install_dir) || echo  Could not remove $(pymodelica_install_dir)
451        if [ -d $(pyfmi_build_dir)/PyFMI ]; then \
452                -cd $(pyfmi_build_dir)/PyFMI; \
453                python setup.py  clean --all; \
454                cd $(abs_builddir); \
455        fi;
456        -rm -rf $(pyfmi_build_dir) || echo  Could not remove $(pyfmi_build_dir)
457        -rm -rf $(pyfmi_install_dir) || echo  Could not remove $(pyfmi_install_dir)
458        -cd $(abs_top_srcdir)/Python/src; \
459        python setup_pyjmi.py clean --all
460        -rm -rf $(pyjmi_install_dir)|| echo  Could not remove $(pyjmi_install_dir)
461endif
462
463clean-frontends:
464if HAVE_ANT
465        rm -rf $(JAVA_BUILD_DIR)
466endif
467
468docs:
469        cd $(abs_top_srcdir); doxygen doc/ModelicaCompiler/modelica_compiler_doxydoc.conf
470        cd $(abs_top_srcdir); doxygen doc/OptimicaCompiler/optimica_compiler_doxydoc.conf
471        make -C $(abs_top_srcdir)/doc/PyJMI html
472
Note: See TracBrowser for help on using the repository browser.