source: branches/ASTDrivenEditor/Makefile.am @ 13800

Last change on this file since 13800 was 3008, checked in by jakesson, 8 years ago

Added building of CasADi to the JModelica.org build system, see #1714.

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