source: branches/DelayInOptimization/Makefile.am @ 13800

Last change on this file since 13800 was 6113, checked in by Tove Bergdahl, 6 years ago

#3549: Fix for build problem introduced in r6112 (separateProcess jar accidentally added to casadi install).

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