source: branches/1.13.x/Makefile.am @ 13800

Last change on this file since 13800 was 6087, checked in by Jonathan Kämpe, 6 years ago

#2963: Constant evaluation for external function calls. Reverting r6004 and r6020 on release branch (removing feature entirely from release) since this early version of the feature is to unstable to be in a release.

File size: 19.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
19
20# EXTRA_DIST =
21
22# SUBDIRS = ThirdParty/Sundials ThirdParty/Zlib ThirdParty/Minizip ThirdParty/Expat JMI/src ThirdParty/Blas ThirdParty/Lapack external/FMILibrary
23SUBDIRS = ThirdParty/Sundials ThirdParty/Minpack JMI/src ThirdParty/Blas ThirdParty/Lapack external/FMILibrary RuntimeLibrary
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
29
30bindistdir=JModelica.org-$(VERSION)-bin
31
32casadi:
33        cd $(abs_builddir)/ThirdParty/CasADi; \
34        make -f Makefile
35
36install_casadi: casadi
37        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/CasADi/lib
38        cp $(abs_builddir)/casadi_build/lib/*.* $(DESTDIR)$(prefix)/ThirdParty/CasADi/lib
39        mkdir -p $(DESTDIR)$(prefix)/Python/
40        cp -r $(abs_builddir)/casadi_install/casadi $(DESTDIR)$(prefix)/Python/
41        ## temp fix
42        cp $(abs_builddir)/casadi_build/swig/casadi.py $(DESTDIR)$(prefix)/Python/casadi
43
44## Install for CasADiInterface, Variables and targets.
45## MC_interface installs the system with Python.
46## If C++ compilation/tests are wanted there is the target MC_interface_cplusplus
47
48MC_INTERFACE=$(abs_top_srcdir)/ModelicaCasADiInterface
49
50export CASADI_HOME=$(abs_top_srcdir)/ThirdParty/CasADi/CasADi
51MC_SRC=$(abs_top_srcdir)/Compiler/ModelicaCompilerCasADi
52OC_SRC=$(abs_top_srcdir)/Compiler/OptimicaCompilerCasADi
53
54# The modelica casadi interface is built into a build folder
55MC_BUILD=$(abs_builddir)/ModelicaCasADiInterfaceBuild
56# Jars from the modified modelica and optimica compilers are put into the JModelica folder
57MC_COMPILERS_DIR=$(MC_BUILD)/JModelica.org
58MC_LIB=$(DESTDIR)$(prefix)/lib/casadi_interface
59
60CASADI_BUILD_DIR=$(abs_builddir)/casadi_build
61
62
63# The CMake for ModelicaCasADi needs these variables.
64export MODELICA_CASADI_HOME= $(MC_INTERFACE)
65export MC_BUILD
66export IPOPT_HOME
67export CASADI_BUILD_DIR
68 
69casadi_interface: casadi install_casadi $(MC_LIB) modelicacasadi_wrapper $(DESTDIR)$(prefix)/Python/modelicacasadi_transfer/__init__.py $(DESTDIR)$(prefix)/Python/modelicacasadi_wrapper/__init__.py $(DESTDIR)$(prefix)/Python/modelicacasadi_transfer/modelica_casadi_transfer_wrapper.py
70
71ifcasadi: casadi
72        mkdir -p $(MC_BUILD)/ifcasadi; \
73        cd $(MC_BUILD)/ifcasadi; \
74        case $(build) in \
75        *-cygwin*) \
76        cmake $(MC_SRC)/src/swig -G "MSYS Makefiles" ;; \
77        *-mingw*) \
78        cmake $(MC_SRC)/src/swig -G "MSYS Makefiles" ;; \
79        *) \
80        cmake $(MC_SRC)/src/swig ;; \
81        esac
82        cd $(MC_BUILD)/ifcasadi;  make
83
84$(MC_LIB): $(MC_SRC)/bin/ModelicaCompiler.jar $(OC_SRC)/bin/OptimicaCompiler.jar $(MC_SRC)/bin/util.jar ifcasadi
85        rm -rf $(MC_LIB)
86        mkdir -p $(MC_LIB)
87        cp $(MC_SRC)/bin/ModelicaCompiler.jar $(MC_LIB)
88        cp $(OC_SRC)/bin/OptimicaCompiler.jar $(MC_LIB)
89        cp $(MC_SRC)/bin/util.jar $(MC_LIB)
90        case $(build) in \
91        *-cygwin*) \
92        cp $(MC_BUILD)/ifcasadi/ifcasadi.dll $(MC_LIB) ;; \
93        *-mingw*) \
94        cp $(MC_BUILD)/ifcasadi/ifcasadi.dll $(MC_LIB) ;; \
95        *) \
96        cp $(MC_BUILD)/ifcasadi/libifcasadi.so $(MC_LIB) ;; \
97        esac
98
99mc_modelica: ifcasadi
100        cd $(MC_SRC); $(ANT_OPTS) $(ANT)
101
102mc_optimica: ifcasadi
103        mkdir -p $(OC_SRC)/src/java-generated
104        cp -pr $(MC_SRC)/src/java-generated/casadi $(OC_SRC)/src/java-generated
105        cd $(OC_SRC); $(ANT_OPTS) $(ANT)
106
107$(MC_SRC)/bin/ModelicaCompiler.jar: mc_modelica
108$(MC_SRC)/bin/util.jar:             mc_modelica
109
110$(OC_SRC)/bin/OptimicaCompiler.jar: mc_optimica
111$(OC_SRC)/bin/util.jar:             mc_optimica
112
113$(MC_BUILD)/modelicacasadi_wrapper/swig/modelicacasadi_wrapper.py: modelicacasadi_wrapper
114
115modelicacasadi_wrapper:
116        mkdir -p $(MC_BUILD)/modelicacasadi_wrapper; \
117        cd $(MC_BUILD)/modelicacasadi_wrapper; \
118        case $(build) in \
119        *-cygwin*) \
120        cmake $(MC_INTERFACE) -G "MSYS Makefiles" ;; \
121        *-mingw*) \
122        cmake $(MC_INTERFACE) -G "MSYS Makefiles" ;; \
123        *) \
124        cmake $(MC_INTERFACE) ;; \
125        esac
126        cd $(MC_BUILD)/modelicacasadi_wrapper;  make modelicacasadi_wrapper
127
128
129 $(DESTDIR)$(prefix)/Python/modelicacasadi_transfer/__init__.py: install_modelicacasadi_transfer
130 $(DESTDIR)$(prefix)/Python/modelicacasadi_transfer/modelica_casadi_transfer_wrapper.py: install_modelicacasadi_transfer
131 
132 $(DESTDIR)$(prefix)/Python/modelicacasadi_wrapper/__init__.py: install_modelicacasadi_wrapper
133 
134 install_modelicacasadi_wrapper: $(MC_BUILD)/modelicacasadi_wrapper/swig/modelicacasadi_wrapper.py
135        mkdir -p $(DESTDIR)$(prefix)/Python/modelicacasadi_wrapper
136        cp $(MC_BUILD)/modelicacasadi_wrapper/swig/*modelicacasadi_wrapper* $(DESTDIR)$(prefix)/Python/modelicacasadi_wrapper
137        rm -f $(DESTDIR)$(prefix)/Python/modelicacasadi_wrapper/__init__.py
138        touch $(DESTDIR)$(prefix)/Python/modelicacasadi_wrapper/__init__.py
139        echo "from modelicacasadi_wrapper import *" >> $(DESTDIR)$(prefix)/Python/modelicacasadi_wrapper/__init__.py
140 
141 install_modelicacasadi_transfer: $(MC_INTERFACE)/python/modelica_casadi_transfer_wrapper.py
142        mkdir -p $(DESTDIR)$(prefix)/Python/modelicacasadi_transfer
143        rm -f $(DESTDIR)$(prefix)/Python/modelicacasadi_transfer/__init__.py
144        touch $(DESTDIR)$(prefix)/Python/modelicacasadi_transfer/__init__.py
145        echo "from modelica_casadi_transfer_wrapper import *" >> $(DESTDIR)$(prefix)/Python/modelicacasadi_transfer/__init__.py
146        cp $(MC_INTERFACE)/python/modelica_casadi_transfer_wrapper.py $(DESTDIR)$(prefix)/Python/modelicacasadi_transfer
147       
148build-python-packages:
149if WITH_SUNDIALS
150if WITH_SUPERLU
151        cd $(abs_top_srcdir)/external/Assimulo; \
152        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)
153endif
154endif
155if WITH_SUNDIALS
156if !WITH_SUPERLU
157        cd $(abs_top_srcdir)/external/Assimulo; \
158        python setup.py install --sundials-home=$(SUNDIALS_HOME) --blas-home=$(abs_builddir)/ThirdParty/Blas/ --lapack-home=$(abs_builddir)/ThirdParty/Lapack/ --prefix=$(assimulo_install_dir)
159endif
160endif
161        cd $(abs_top_srcdir)/Python/src; \
162        python setup_pymodelica.py install --prefix=$(pymodelica_install_dir); \
163        rm -rf build
164
165        cd $(abs_top_srcdir)/external/PyFMI; \
166        python setup.py install --fmil-home=$(abs_builddir)/FMIL_install/ --prefix=$(pyfmi_install_dir); \
167        rm -rf build
168
169        cd $(abs_top_srcdir)/Python/src; \
170        python setup_pyjmi.py install --prefix=$(pyjmi_install_dir); \
171        rm -rf build
172
173install-python-packages: build-python-packages
174        mkdir -p $(DESTDIR)$(prefix)/Python
175        cp $(abs_top_srcdir)/Python/src/startup.py $(DESTDIR)$(prefix)/
176        [ $(abs_top_srcdir) == $(DESTDIR)$(prefix) ] && echo "Installing in dist directory, don't copy LICENSE file" || cp $(abs_top_srcdir)/Python/LICENSE $(DESTDIR)$(prefix)/Python
177if WITH_SUNDIALS
178        for pkgdir in lib/python2.5 lib/python2.6 lib/python2.7 lib64/python2.5 lib64/python2.6 lib64/python2.7 Lib; do \
179        if [ -e $(assimulo_install_dir)/$${pkgdir}/site-packages/ ]; \
180        then \
181        cd $(assimulo_install_dir)/$${pkgdir}/site-packages/; \
182        find assimulo -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(DESTDIR)$(prefix)/Python; \
183        fi; \
184        done
185endif
186        for pkgdir in lib/python2.5 lib/python2.6 lib/python2.7 lib64/python2.5 lib64/python2.6 lib64/python2.7 Lib; do \
187        if [ -e $(pymodelica_install_dir)/$${pkgdir}/site-packages/ ]; \
188        then \
189        cd $(pymodelica_install_dir)/$${pkgdir}/site-packages/; \
190        find pymodelica -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(DESTDIR)$(prefix)/Python; \
191        fi; \
192        done
193        for pkgdir in lib/python2.5 lib/python2.6 lib/python2.7 lib64/python2.5 lib64/python2.6 lib64/python2.7 Lib; do \
194        if [ -e $(pyjmi_install_dir)/$${pkgdir}/site-packages/ ]; \
195        then \
196        cd $(pyjmi_install_dir)/$${pkgdir}/site-packages/; \
197        find pyjmi -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(DESTDIR)$(prefix)/Python; \
198        fi; \
199        done
200        for pkgdir in lib/python2.5 lib/python2.6 lib/python2.7 lib64/python2.5 lib64/python2.6 lib64/python2.7 Lib; do \
201        if [ -e $(pyfmi_install_dir)/$${pkgdir}/site-packages/ ]; \
202        then \
203        cd $(pyfmi_install_dir)/$${pkgdir}/site-packages/; \
204        find pyfmi -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(DESTDIR)$(prefix)/Python; \
205        fi; \
206        done
207        cd $(abs_top_srcdir)/Python/src/tests_jmodelica/; \
208        mkdir -p $(DESTDIR)$(prefix)/Python/tests_jmodelica; \
209        find . -type f |grep -v /.svn | grep -v .pyc | grep -v ~ |tar c -T - -f - | tar x -C $(DESTDIR)$(prefix)/Python/tests_jmodelica
210        mkdir -p $(DESTDIR)$(prefix)/bin
211        [ -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
212        [ -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
213        chmod ugo+x $(DESTDIR)$(prefix)/bin/jm_*.sh
214
215# Hooks for extra build or install actions. Must be empty or the path of a shell script to execute.
216# Both scripts will get the source directory as the first argument and the install directory as the second.
217BUILD_EXTRA=
218INSTALL_EXTRA=
219
220# Paths for Java build
221JAVA_BUILD_DIR=$(abs_builddir)/java
222COMPILER_DIR=$(abs_top_srcdir)/Compiler
223JAVA_MC_ANT_FILE=$(COMPILER_DIR)/ModelicaCompiler/build.xml
224JAVA_OC_ANT_FILE=$(COMPILER_DIR)/OptimicaCompiler/build.xml
225
226all-local: build-python-packages
227if HAVE_ANT
228        mkdir -p $(JAVA_BUILD_DIR)
229        cd $(JAVA_BUILD_DIR); \
230        $(ANT_OPTS) $(ANT) -f "$(JAVA_MC_ANT_FILE)" "-Dcompiler=$(COMPILER_DIR)"
231        cd $(JAVA_BUILD_DIR); \
232        $(ANT_OPTS) $(ANT) -f "$(JAVA_OC_ANT_FILE)" "-Dcompiler=$(COMPILER_DIR)"
233endif
234        $(abs_top_srcdir)/get_version.sh $(abs_top_srcdir) > $(abs_builddir)/version.txt
235        mkdir -p $(abs_builddir)/Options
236        $(abs_top_srcdir)/run_java.sh org.jmodelica.util.OptionRegistry $(abs_builddir)/Options/options.xml
237        if [ "$(BUILD_EXTRA)" ]; then exec "$(BUILD_EXTRA)" "$(abs_top_srcdir)" "$(DESTDIR)$(prefix)"; fi
238
239install-exec-local: install-python-packages
240if HAVE_ANT
241        cp $(JAVA_BUILD_DIR)/bin/ModelicaCompiler.jar $(DESTDIR)$(prefix)/lib/
242        cp $(JAVA_BUILD_DIR)/bin/util.jar $(DESTDIR)$(prefix)/lib/
243        cp $(JAVA_BUILD_DIR)/bin/OptimicaCompiler.jar $(DESTDIR)$(prefix)/lib/
244endif
245        [ $(abs_top_srcdir) == $(DESTDIR)$(prefix) ] && echo "Installing in dist directory, don't copy LICENSE file" || cp $(abs_top_srcdir)/LICENSE $(DESTDIR)$(prefix)/
246        cp $(abs_top_srcdir)/JMI/LICENSE_GPL $(DESTDIR)$(prefix)/lib/
247        cp $(abs_top_srcdir)/JMI/LICENSE_CPL $(DESTDIR)$(prefix)/lib/
248        cp $(abs_top_srcdir)/JMI/LICENSE_GPL $(DESTDIR)$(prefix)/include/
249        cp $(abs_top_srcdir)/JMI/LICENSE_CPL $(DESTDIR)$(prefix)/include/
250        mkdir -p $(DESTDIR)$(prefix)/Makefiles
251        cp $(abs_top_srcdir)/JMI/LICENSE_GPL $(DESTDIR)$(prefix)/Makefiles/LICENSE
252#       case $(build) in \
253#       *-cygwin*) \
254#       cp $(abs_top_srcdir)/JMI/Makefiles/Makefile.windows $(DESTDIR)$(prefix)/Makefiles/Makefile ;; \
255#       *-mingw*) \
256#       cp $(abs_top_srcdir)/JMI/Makefiles/Makefile.windows $(DESTDIR)$(prefix)/Makefiles/MakeFile ;; \
257#       *-apple*) \
258#       cp $(abs_top_srcdir)/JMI/Makefiles/Makefile.macosx $(DESTDIR)$(prefix)/Makefiles/MakeFile ;; \
259#       *) \
260#       cp $(abs_top_srcdir)/JMI/Makefiles/Makefile.linux $(DESTDIR)$(prefix)/Makefiles/MakeFile ;; \
261#       esac
262        case $(build) in \
263        *-cygwin*) \
264        cp $(abs_top_srcdir)/RuntimeLibrary/Makefiles/Makefile.windows $(DESTDIR)$(prefix)/Makefiles/Makefile ;; \
265        *-mingw*) \
266        cp $(abs_top_srcdir)/RuntimeLibrary/Makefiles/Makefile.windows $(DESTDIR)$(prefix)/Makefiles/MakeFile ;; \
267        *-apple*) \
268        cp $(abs_top_srcdir)/RuntimeLibrary/Makefiles/Makefile.macosx $(DESTDIR)$(prefix)/Makefiles/MakeFile ;; \
269        *) \
270        cp $(abs_top_srcdir)/RuntimeLibrary/Makefiles/Makefile.linux $(DESTDIR)$(prefix)/Makefiles/MakeFile ;; \
271        esac
272        if [ "$(INSTALL_EXTRA)" ]; then exec "$(INSTALL_EXTRA)" "$(abs_top_srcdir)" "$(DESTDIR)$(prefix)"; fi
273
274if WITH_MINGW
275        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/pthreads/lib
276        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/pthreads/include
277        cp $(abs_top_srcdir)/ThirdParty/pthreads/lib/win32/libpthreadGC2-2-9-1.a $(DESTDIR)$(prefix)/ThirdParty/pthreads/lib
278        cp $(abs_top_srcdir)/ThirdParty/pthreads/include/*.h $(DESTDIR)$(prefix)/ThirdParty/pthreads/include
279endif
280
281        mkdir -p $(DESTDIR)$(prefix)/Options
282        cp $(abs_builddir)/Options/options.xml $(DESTDIR)$(prefix)/Options/options.xml
283        mkdir -p $(DESTDIR)$(prefix)/ThirdParty
284        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/Beaver
285        cp $(abs_top_srcdir)/ThirdParty/Beaver/beaver-0.9.6.1/LICENSE $(DESTDIR)$(prefix)/ThirdParty/Beaver/
286        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/Beaver/lib
287        cp $(abs_top_srcdir)/ThirdParty/Beaver/beaver-0.9.6.1/lib/beaver-rt.jar $(DESTDIR)$(prefix)/ThirdParty/Beaver/lib/
288        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/Sundials       
289        cp -r $(SUNDIALS_HOME)/* $(DESTDIR)$(prefix)/ThirdParty/Sundials
290        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/Minpack
291        cp -r $(MINPACK_HOME)/* $(DESTDIR)$(prefix)/ThirdParty/Minpack
292        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/CppAD
293        cp $(CPPAD_HOME)/COPYING $(DESTDIR)$(prefix)/ThirdParty/CppAD
294        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/CppAD/cppad     
295        cp $(CPPAD_HOME)/cppad/*.h $(DESTDIR)$(prefix)/ThirdParty/CppAD/cppad
296        cp $(CPPAD_HOME)/cppad/*.hpp $(DESTDIR)$(prefix)/ThirdParty/CppAD/cppad
297        mkdir -p $(DESTDIR)$(prefix)/ThirdParty/CppAD/cppad/local       
298        cp $(CPPAD_HOME)/cppad/local/*.hpp $(DESTDIR)$(prefix)/ThirdParty/CppAD/cppad/local
299        if [ $(abs_top_srcdir) == $(DESTDIR)$(prefix) ]; then \
300          echo "Installing in dist directory, don't copy MSL"; \
301        else \
302          mkdir -p "$(DESTDIR)$(prefix)/ThirdParty/MSL"; \
303          cd "$(DESTDIR)$(prefix)/ThirdParty/MSL"; \
304          find . -depth -print0 | while read -d $$'\0' -r f ; do if [ ! -e "$(abs_top_srcdir)/ThirdParty/MSL/$${f}" ]; then rm -rf "$${f}"; fi; done; \
305          cd "$(abs_top_srcdir)/ThirdParty/MSL"; \
306          $(CP) Modelica ModelicaServices Complex.mo "$(DESTDIR)$(prefix)/ThirdParty/MSL"; \
307        fi
308        mkdir -p $(DESTDIR)$(prefix)/CodeGenTemplates
309        cp $(abs_top_srcdir)/JMI/LICENSE_GPL $(DESTDIR)$(prefix)/CodeGenTemplates/LICENSE
310        cp  $(abs_top_srcdir)/Compiler/ModelicaCBackEnd/templates/jmi_modelica_template.c $(DESTDIR)$(prefix)/CodeGenTemplates
311        cp  $(abs_top_srcdir)/Compiler/ModelicaCBackEnd/templates/fmi1_me_modelica_template.c $(DESTDIR)$(prefix)/CodeGenTemplates
312        cp  $(abs_top_srcdir)/Compiler/ModelicaCBackEnd/templates/fmi1_cs_modelica_template.c $(DESTDIR)$(prefix)/CodeGenTemplates
313        cp  $(abs_top_srcdir)/Compiler/ModelicaCBackEnd/templates/fmi2_master_modelica_template.c $(DESTDIR)$(prefix)/CodeGenTemplates
314        cp  $(abs_top_srcdir)/Compiler/ModelicaCBackEnd/templates/fmi_code_gen_template.c $(DESTDIR)$(prefix)/CodeGenTemplates
315        cp  $(abs_top_srcdir)/Compiler/ModelicaCBackEnd/templates/fmi2_functions_common_template.c $(DESTDIR)$(prefix)/CodeGenTemplates
316        cp  $(abs_top_srcdir)/Compiler/ModelicaCBackEnd/templates/fmi2_functions_me_template.c $(DESTDIR)$(prefix)/CodeGenTemplates
317        cp  $(abs_top_srcdir)/Compiler/ModelicaCBackEnd/templates/fmi2_functions_cs_template.c $(DESTDIR)$(prefix)/CodeGenTemplates
318        cp  $(abs_top_srcdir)/Compiler/OptimicaCBackEnd/templates/jmi_optimica_template.c $(DESTDIR)$(prefix)/CodeGenTemplates
319        cp  $(abs_top_srcdir)/Compiler/ModelicaFMUXBackEnd/templates/*.tpl $(DESTDIR)$(prefix)/CodeGenTemplates
320        mkdir -p $(DESTDIR)$(prefix)/XML
321        [ $(abs_top_srcdir) == $(DESTDIR)$(prefix) ] && echo "Installing in dist directory, don't copy XML schemas"  || cp  $(abs_top_srcdir)/XML/*.xsd $(DESTDIR)$(prefix)/XML
322        [ $(abs_top_srcdir) == $(DESTDIR)$(prefix) ] && echo "Installing in dist directory, don't copy XML LICENSE"  || cp  $(abs_top_srcdir)/XML/LICENSE $(DESTDIR)$(prefix)/XML
323        cp  $(abs_builddir)/version.txt $(DESTDIR)$(prefix)
324        cp jm_tests $(DESTDIR)$(prefix)/jm_tests
325        chmod ugo+x $(DESTDIR)$(prefix)/jm_tests
326
327bindistdir: install
328        rm -rf $(bindistdir)
329        mkdir -p $(bindistdir)
330        cp $(DESTDIR)$(prefix)/LICENSE $(bindistdir)
331        cp $(DESTDIR)$(prefix)/startup.py $(bindistdir)
332        cp $(DESTDIR)$(prefix)/version.txt $(bindistdir)
333        cp -r $(DESTDIR)$(prefix)/CodeGenTemplates $(bindistdir)
334        cp -r $(DESTDIR)$(prefix)/Makefiles $(bindistdir)
335        cp -r $(DESTDIR)$(prefix)/Options $(bindistdir)
336        cp -r $(DESTDIR)$(prefix)/Python $(bindistdir)
337        cp -r $(DESTDIR)$(prefix)/ThirdParty $(bindistdir)
338        cp -r $(DESTDIR)$(prefix)/XML $(bindistdir)
339        cp -r $(DESTDIR)$(prefix)/include $(bindistdir)
340        cp -r $(DESTDIR)$(prefix)/lib $(bindistdir)
341if COMPILE_WITH_IPOPT   
342        mkdir -p $(bindistdir)/ThirdParty/Ipopt
343# Copy files
344        cd $(IPOPT_HOME); find * -type f |grep -v /.svn | grep -v ~ |tar c -T - -f - | tar x -C $(abs_builddir)/$(bindistdir)/ThirdParty/Ipopt
345# Copy symbolic links
346        cd $(IPOPT_HOME); find * -type l |grep -v /.svn | grep -v ~ |tar c -T - -f - | tar x -C $(abs_builddir)/$(bindistdir)/ThirdParty/Ipopt
347endif
348
349if WITH_MINGW   
350        mkdir -p $(bindistdir)/ThirdParty/MinGW
351# Copy files
352        cd $(MINGW_HOME); find * -type f |grep -v /.svn | grep -v ~ |tar c -T - -f - | tar x -C $(abs_builddir)/$(bindistdir)/ThirdParty/MinGW
353# Copy symbolic links
354        cd $(MINGW_HOME); find * -type l |grep -v /.svn | grep -v ~ |tar c -T - -f - | tar x -C $(abs_builddir)/$(bindistdir)/ThirdParty/MinGW
355endif
356
357bindist: bindistdir
358        tar -cf $(bindistdir).tar $(bindistdir)
359        gzip -c $(bindistdir).tar > $(bindistdir).tar.gz
360        rm -rf $(bindistdir)
361        rm -rf $(bindistdir).tar
362
363test: install
364        $(prefix)/jm_tests -i
365
366clean-local: clean-frontends clean-python-packages clean-casadi-interface
367
368clean-casadi-interface:
369        rm -rf $(MC_BUILD)
370#       rm -rf $(DESTDIR)$(prefix)/Python/casadi
371#       rm -rf $(DESTDIR)$(prefix)/Python/modelicacasadi_transfer
372if HAVE_ANT
373        cd $(abs_top_srcdir)/Compiler/ModelicaCompilerCasADi; \
374        $(ANT_OPTS) $(ANT) clean ; rm -rf $(MC_SRC)/src/cpp-generated $(MC_SRC)/src/java-generated/casadi
375        cd $(abs_top_srcdir)/Compiler/OptimicaCompilerCasADi; \
376        $(ANT_OPTS) $(ANT) clean ; rm -rf $(OC_SRC)/src/cpp-generated $(OC_SRC)/src/java-generated/casadi
377endif
378       
379
380clean-python-packages:
381if WITH_SUNDIALS
382        cd $(abs_top_srcdir)/external/Assimulo; \
383        python setup.py clean --all --sundials-home=$(SUNDIALS_HOME)
384        rm -rf $(assimulo_install_dir) || echo  Could not remove $(assimulo_install_dir)
385endif
386        -cd $(abs_top_srcdir)/Python/src; \
387        python setup_pymodelica.py clean --all
388        -rm -rf $(pymodelica_install_dir) || echo  Could not remove $(pymodelica_install_dir)
389        -cd $(abs_top_srcdir)/external/PyFMI; \
390        python setup.py  clean --all
391        -rm -rf $(pyfmi_install_dir) || echo  Could not remove $(pyfmi_install_dir)
392        -cd $(abs_top_srcdir)/Python/src; \
393        python setup_pyjmi.py clean --all
394        -rm -rf $(pyjmi_install_dir)|| echo  Could not remove $(pyjmi_install_dir)
395
396clean-frontends:
397if HAVE_ANT
398        rm -rf $(JAVA_BUILD_DIR)
399endif
400
401docs:
402        cd $(abs_top_srcdir); doxygen doc/JMI/jmi_doxydoc.conf
403        cd $(abs_top_srcdir); doxygen doc/ModelicaCompiler/modelica_compiler_doxydoc.conf
404        cd $(abs_top_srcdir); doxygen doc/OptimicaCompiler/optimica_compiler_doxydoc.conf
405        make -C $(abs_top_srcdir)/doc/PyJMI html
406
407docbook-docs:
408        cd docbook/UsersGuide; $(MAKE) all
409
410
411.PHONY: modelicacasadi_wrapper ifcasadi install_modelicacasadi_transfer install_modelicacasadi_wrapper
Note: See TracBrowser for help on using the repository browser.