source: branches/dev-5819/Makefile.am @ 13905

Last change on this file since 13905 was 13905, checked in by randersson, 7 weeks ago

#5819 Fixed another tab issue in Makefile.am

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