source: branches/JMILoggingXML/Makefile.am @ 13800

Last change on this file since 13800 was 4546, checked in by Christian Andersson, 7 years ago

Reintegrated branch for development of cs-export into trunk. Related to ticket:2324

File size: 12.5 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
17
18# EXTRA_DIST =
19
20# SUBDIRS = ThirdParty/Sundials ThirdParty/Zlib ThirdParty/Minizip ThirdParty/Expat JMI/src ThirdParty/Blas ThirdParty/Lapack external/FMILibrary
21SUBDIRS = ThirdParty/Sundials JMI/src ThirdParty/Blas ThirdParty/Lapack external/FMILibrary
22
23assimulo_install_dir=$(abs_builddir)/Assimulo_install
24pymodelica_install_dir=$(abs_builddir)/pymodelica_install
25pyfmi_install_dir=$(abs_builddir)/PyFMI_install
26pyjmi_install_dir=$(abs_builddir)/PyJMI_install
27
28bindistdir=JModelica.org-$(VERSION)-bin
29
30casadi:
31        cd $(abs_builddir)/ThirdParty/CasADi; \
32        make -f Makefile
33
34install_casadi: casadi
35        cd $(abs_builddir)/casadi_build/python/; \
36        find . -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(DESTDIR)$(prefix)/Python/
37
38
39build-python-packages:
40if WITH_SUNDIALS
41if WITH_SUPERLU
42        cd $(abs_top_srcdir)/external/Assimulo; \
43        python setup.py install --sundials-home=$(SUNDIALS_HOME) --superlu-home=$(SUPERLU_HOME) --blas-home=$(abs_builddir)/ThirdParty/Blas/ --lapack-home=$(abs_builddir)/ThirdParty/Lapack/ --prefix=$(assimulo_install_dir)
44endif
45endif
46if WITH_SUNDIALS
47if !WITH_SUPERLU
48        cd $(abs_top_srcdir)/external/Assimulo; \
49        python setup.py install --sundials-home=$(SUNDIALS_HOME) --blas-home=$(abs_builddir)/ThirdParty/Blas/ --lapack-home=$(abs_builddir)/ThirdParty/Lapack/ --prefix=$(assimulo_install_dir)
50endif
51endif
52        cd $(abs_top_srcdir)/Python/src; \
53        python setup_pymodelica.py install --prefix=$(pymodelica_install_dir); \
54        rm -rf build
55
56        cd $(abs_top_srcdir)/external/PyFMI; \
57        python setup.py install --fmil-home=$(abs_builddir)/FMIL_install/ --prefix=$(pyfmi_install_dir); \
58        rm -rf build
59
60        cd $(abs_top_srcdir)/Python/src; \
61        python setup_pyjmi.py install --prefix=$(pyjmi_install_dir); \
62        rm -rf build
63
64install-python-packages: build-python-packages
65        mkdir -p $(DESTDIR)$(prefix)/Python
66        cp $(abs_top_srcdir)/Python/src/startup.py $(DESTDIR)$(prefix)/
67        [ $(abs_top_srcdir) == $(DESTDIR)$(prefix) ] && echo "Installing in dist directory, don't copy LICENSE file" || cp $(abs_top_srcdir)/Python/LICENSE $(DESTDIR)$(prefix)/Python
68if WITH_SUNDIALS
69        for pkgdir in lib/python2.5 lib/python2.6 lib/python2.7 lib64/python2.5 lib64/python2.6 lib64/python2.7 Lib; do \
70        if [ -e $(assimulo_install_dir)/$${pkgdir}/site-packages/ ]; \
71        then \
72        cd $(assimulo_install_dir)/$${pkgdir}/site-packages/; \
73        find assimulo -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(DESTDIR)$(prefix)/Python; \
74        fi; \
75        done
76endif
77        for pkgdir in lib/python2.5 lib/python2.6 lib/python2.7 lib64/python2.5 lib64/python2.6 lib64/python2.7 Lib; do \
78        if [ -e $(pymodelica_install_dir)/$${pkgdir}/site-packages/ ]; \
79        then \
80        cd $(pymodelica_install_dir)/$${pkgdir}/site-packages/; \
81        find pymodelica -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(DESTDIR)$(prefix)/Python; \
82        fi; \
83        done
84        for pkgdir in lib/python2.5 lib/python2.6 lib/python2.7 lib64/python2.5 lib64/python2.6 lib64/python2.7 Lib; do \
85        if [ -e $(pyjmi_install_dir)/$${pkgdir}/site-packages/ ]; \
86        then \
87        cd $(pyjmi_install_dir)/$${pkgdir}/site-packages/; \
88        find pyjmi -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(DESTDIR)$(prefix)/Python; \
89        fi; \
90        done
91        for pkgdir in lib/python2.5 lib/python2.6 lib/python2.7 lib64/python2.5 lib64/python2.6 lib64/python2.7 Lib; do \
92        if [ -e $(pyfmi_install_dir)/$${pkgdir}/site-packages/ ]; \
93        then \
94        cd $(pyfmi_install_dir)/$${pkgdir}/site-packages/; \
95        find pyfmi -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(DESTDIR)$(prefix)/Python; \
96        fi; \
97        done
98        cd $(abs_top_srcdir)/Python/src/tests_jmodelica/; \
99        mkdir -p $(DESTDIR)$(prefix)/Python/tests_jmodelica; \
100        find . -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(DESTDIR)$(prefix)/Python/tests_jmodelica
101        mkdir -p $(DESTDIR)$(prefix)/bin
102        [ -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
103        [ -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
104        chmod ugo+x $(DESTDIR)$(prefix)/bin/jm_*.sh
105
106all-local: build-python-packages
107if HAVE_ANT
108        cd $(abs_top_srcdir)/Compiler/ModelicaCompiler; \
109        $(ANT_OPTS) $(ANT)
110        cd $(abs_top_srcdir)/Compiler/OptimicaCompiler; \
111        $(ANT_OPTS) $(ANT)
112endif
113        $(abs_top_srcdir)/get_version.sh $(abs_top_srcdir) > $(abs_builddir)/version.txt
114        mkdir -p $(abs_builddir)/Options
115        $(abs_top_srcdir)/run_java.sh org.jmodelica.util.OptionRegistry $(abs_builddir)/Options/options.xml
116
117install-exec-local: install-python-packages
118if HAVE_ANT
119        cp $(abs_top_srcdir)/Compiler/ModelicaCompiler/bin/ModelicaCompiler.jar $(DESTDIR)$(prefix)/lib/
120        cp $(abs_top_srcdir)/Compiler/ModelicaCompiler/bin/util.jar $(DESTDIR)$(prefix)/lib/
121        cp $(abs_top_srcdir)/Compiler/ModelicaCompiler/bin/graphs.jar $(DESTDIR)$(prefix)/lib/
122        cp $(abs_top_srcdir)/Compiler/OptimicaCompiler/bin/OptimicaCompiler.jar $(DESTDIR)$(prefix)/lib/
123endif
124        [ $(abs_top_srcdir) == $(DESTDIR)$(prefix) ] && echo "Installing in dist directory, don't copy LICENSE file" || cp $(abs_top_srcdir)/LICENSE $(DESTDIR)$(prefix)/
125        cp $(abs_top_srcdir)/JMI/LICENSE_GPL $(DESTDIR)$(prefix)/lib/
126        cp $(abs_top_srcdir)/JMI/LICENSE_CPL $(DESTDIR)$(prefix)/lib/
127        cp $(abs_top_srcdir)/JMI/LICENSE_GPL $(DESTDIR)$(prefix)/include/
128        cp $(abs_top_srcdir)/JMI/LICENSE_CPL $(DESTDIR)$(prefix)/include/
129        mkdir -p $(DESTDIR)$(prefix)/Makefiles
130        cp $(abs_top_srcdir)/JMI/LICENSE_GPL $(DESTDIR)$(prefix)/Makefiles/LICENSE
131        case $(build) in \
132        *-cygwin*) \
133        cp $(abs_top_srcdir)/JMI/Makefiles/Makefile.windows $(DESTDIR)$(prefix)/Makefiles/Makefile ;; \
134        *-mingw*) \
135        cp $(abs_top_srcdir)/JMI/Makefiles/Makefile.windows $(DESTDIR)$(prefix)/Makefiles/MakeFile ;; \
136        *-apple*) \
137        cp $(abs_top_srcdir)/JMI/Makefiles/Makefile.macosx $(DESTDIR)$(prefix)/Makefiles/MakeFile ;; \
138        *) \
139        cp $(abs_top_srcdir)/JMI/Makefiles/Makefile.linux $(DESTDIR)$(prefix)/Makefiles/MakeFile ;; \
140        esac
141        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/Tables/lib
142        case $(build) in \
143        *-cygwin*) \
144        cp $(abs_top_srcdir)/ThirdParty/Tables/lib/win32/libtblAccess.a $(DESTDIR)$(prefix)/ThirdParty/Tables/lib/  ;; \
145        *-mingw*) \
146        cp $(abs_top_srcdir)/ThirdParty/Tables/lib/win32/libtblAccess.a $(DESTDIR)$(prefix)/ThirdParty/Tables/lib/  ;; \
147        *-apple*) \
148        cp $(abs_top_srcdir)/ThirdParty/Tables/lib/darwin64/libtblAccess.a $(DESTDIR)$(prefix)/ThirdParty/Tables/lib/  ;; \
149        *) \
150        cp $(abs_top_srcdir)/ThirdParty/Tables/lib/linux$(shell getconf LONG_BIT)/libtblAccess.a $(DESTDIR)$(prefix)/ThirdParty/Tables/lib/  ;; \
151        esac
152        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/Tables/include
153        cp $(abs_top_srcdir)/ThirdParty/Tables/include/tblAccess.h $(DESTDIR)$(prefix)/ThirdParty/Tables/include
154        mkdir -p $(DESTDIR)$(prefix)/Options
155        cp $(abs_builddir)/Options/options.xml $(DESTDIR)$(prefix)/Options/options.xml
156        mkdir -p $(DESTDIR)$(prefix)/ThirdParty
157        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/Beaver
158        cp $(abs_top_srcdir)/ThirdParty/Beaver/beaver-0.9.6.1/LICENSE $(DESTDIR)$(prefix)/ThirdParty/Beaver/
159        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/Beaver/lib
160        cp $(abs_top_srcdir)/ThirdParty/Beaver/beaver-0.9.6.1/lib/beaver.jar $(DESTDIR)$(prefix)/ThirdParty/Beaver/lib/
161        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/Sundials       
162        cp -r $(SUNDIALS_HOME)/* $(DESTDIR)$(prefix)/ThirdParty/Sundials
163        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/CppAD
164        cp $(CPPAD_HOME)/COPYING $(DESTDIR)$(prefix)/ThirdParty/CppAD
165        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/CppAD/cppad     
166        cp $(CPPAD_HOME)/cppad/*.h $(DESTDIR)$(prefix)/ThirdParty/CppAD/cppad
167        cp $(CPPAD_HOME)/cppad/*.hpp $(DESTDIR)$(prefix)/ThirdParty/CppAD/cppad
168        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/CppAD/cppad/local       
169        cp $(CPPAD_HOME)/cppad/local/*.hpp $(DESTDIR)$(prefix)/ThirdParty/CppAD/cppad/local
170        [ $(abs_top_srcdir) == $(DESTDIR)$(prefix) ] && echo "Installing in dist directory, don't copy MSL" || cd $(abs_top_srcdir)/ThirdParty; find MSL -type f |grep -v /.svn | grep -v ~ |tar c -T - -f - | tar x -C $(DESTDIR)$(prefix)/ThirdParty
171        mkdir -p $(DESTDIR)$(prefix)/CodeGenTemplates
172        cp $(abs_top_srcdir)/JMI/LICENSE_GPL $(DESTDIR)$(prefix)/CodeGenTemplates/LICENSE
173        cp  $(abs_top_srcdir)/Compiler/ModelicaCBackEnd/templates/jmi_modelica_template.c $(DESTDIR)$(prefix)/CodeGenTemplates
174        cp  $(abs_top_srcdir)/Compiler/ModelicaCBackEnd/templates/fmi_me_modelica_template.c $(DESTDIR)$(prefix)/CodeGenTemplates
175        cp  $(abs_top_srcdir)/Compiler/ModelicaCBackEnd/templates/fmi_cs_modelica_template.c $(DESTDIR)$(prefix)/CodeGenTemplates
176        cp  $(abs_top_srcdir)/Compiler/OptimicaCBackEnd/templates/jmi_optimica_template.c $(DESTDIR)$(prefix)/CodeGenTemplates
177        cp  $(abs_top_srcdir)/Compiler/ModelicaXMLBackEnd/templates/*.tpl $(DESTDIR)$(prefix)/CodeGenTemplates
178        mkdir -p $(DESTDIR)$(prefix)/XML
179        [ $(abs_top_srcdir) == $(DESTDIR)$(prefix) ] && echo "Installing in dist directory, don't copy XML schemas"  || cp  $(abs_top_srcdir)/XML/*.xsd $(DESTDIR)$(prefix)/XML
180        [ $(abs_top_srcdir) == $(DESTDIR)$(prefix) ] && echo "Installing in dist directory, don't copy XML LICENSE"  || cp  $(abs_top_srcdir)/XML/LICENSE $(DESTDIR)$(prefix)/XML
181        cp  $(abs_builddir)/version.txt $(DESTDIR)$(prefix)
182        cp jm_tests $(DESTDIR)$(prefix)/jm_tests
183        chmod ugo+x $(DESTDIR)$(prefix)/jm_tests
184
185bindistdir: install
186        rm -rf $(bindistdir)
187        mkdir -p $(bindistdir)
188        cp $(DESTDIR)$(prefix)/LICENSE $(bindistdir)
189        cp $(DESTDIR)$(prefix)/startup.py $(bindistdir)
190        cp $(DESTDIR)$(prefix)/version.txt $(bindistdir)
191        cp -r $(DESTDIR)$(prefix)/CodeGenTemplates $(bindistdir)
192        cp -r $(DESTDIR)$(prefix)/Makefiles $(bindistdir)
193        cp -r $(DESTDIR)$(prefix)/Options $(bindistdir)
194        cp -r $(DESTDIR)$(prefix)/Python $(bindistdir)
195        cp -r $(DESTDIR)$(prefix)/ThirdParty $(bindistdir)
196        cp -r $(DESTDIR)$(prefix)/XML $(bindistdir)
197        cp -r $(DESTDIR)$(prefix)/include $(bindistdir)
198        cp -r $(DESTDIR)$(prefix)/lib $(bindistdir)
199if COMPILE_WITH_IPOPT   
200        mkdir -p $(bindistdir)/ThirdParty/Ipopt
201# Copy files
202        cd $(IPOPT_HOME); find * -type f |grep -v /.svn | grep -v ~ |tar c -T - -f - | tar x -C $(abs_builddir)/$(bindistdir)/ThirdParty/Ipopt
203# Copy symbolic links
204        cd $(IPOPT_HOME); find * -type l |grep -v /.svn | grep -v ~ |tar c -T - -f - | tar x -C $(abs_builddir)/$(bindistdir)/ThirdParty/Ipopt
205endif
206
207if WITH_MINGW   
208        mkdir -p $(bindistdir)/ThirdParty/MinGW
209# Copy files
210        cd $(MINGW_HOME); find * -type f |grep -v /.svn | grep -v ~ |tar c -T - -f - | tar x -C $(abs_builddir)/$(bindistdir)/ThirdParty/MinGW
211# Copy symbolic links
212        cd $(MINGW_HOME); find * -type l |grep -v /.svn | grep -v ~ |tar c -T - -f - | tar x -C $(abs_builddir)/$(bindistdir)/ThirdParty/MinGW
213endif
214
215bindist: bindistdir
216        tar -cf $(bindistdir).tar $(bindistdir)
217        gzip -c $(bindistdir).tar > $(bindistdir).tar.gz
218        rm -rf $(bindistdir)
219        rm -rf $(bindistdir).tar
220
221test: install
222        $(prefix)/jm_tests -i
223
224clean-local: clean-frontends clean-python-packages
225
226clean-python-packages:
227if WITH_SUNDIALS
228        cd $(abs_top_srcdir)/external/Assimulo; \
229        python setup.py clean --all --sundials-home=$(SUNDIALS_HOME)
230        rm -rf $(assimulo_install_dir) || echo  Could not remove $(assimulo_install_dir)
231endif
232        -cd $(abs_top_srcdir)/Python/src; \
233        python setup_pymodelica.py clean --all
234        -rm -rf $(pymodelica_install_dir) || echo  Could not remove $(pymodelica_install_dir)
235        -cd $(abs_top_srcdir)/external/PyFMI; \
236        python setup.py  clean --all
237        -rm -rf $(pyfmi_install_dir) || echo  Could not remove $(pyfmi_install_dir)
238        -cd $(abs_top_srcdir)/Python/src; \
239        python setup_pyjmi.py clean --all
240        -rm -rf $(pyjmi_install_dir)|| echo  Could not remove $(pyjmi_install_dir)
241
242clean-frontends:
243if HAVE_ANT
244        cd $(abs_top_srcdir)/Compiler/ModelicaCompiler; \
245        $(ANT_OPTS) $(ANT) clean
246        cd $(abs_top_srcdir)/Compiler/OptimicaCompiler; \
247        $(ANT_OPTS) $(ANT) clean
248endif
249
250docs:
251        cd $(abs_top_srcdir); doxygen doc/JMI/jmi_doxydoc.conf
252        cd $(abs_top_srcdir); doxygen doc/ModelicaCompiler/modelica_compiler_doxydoc.conf
253        cd $(abs_top_srcdir); doxygen doc/OptimicaCompiler/optimica_compiler_doxydoc.conf
254        make -C $(abs_top_srcdir)/doc/PyJMI html
255
256docbook-docs:
257        cd docbook/UsersGuide; $(MAKE) all
258
Note: See TracBrowser for help on using the repository browser.