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

Last change on this file since 13902 was 13902, checked in by aramle, 6 weeks ago

#5819 Updates after review.

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