forked from OpenModelica/OMCompiler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.omdev.mingw
459 lines (409 loc) · 25.5 KB
/
Makefile.omdev.mingw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
# makefile for Windows MinGW OMDev
all : .testvariables settings omc
autoconfGeneratedFiles =
ifeq ($(OMBUILDDIR),)
OMBUILDDIR=$(CURDIR)/build
endif
prefix = ./build
exec_prefix = ${prefix}
bindir = ${exec_prefix}/bin
libdir = ${exec_prefix}/lib
includedir = ${prefix}/include
datadir = ${prefix}/share
docdir = ${prefix}/doc
CC = gcc
CXX = g++
FC = gfortran
CFLAGS =-g -O2 -falign-functions
MSGPACK_CFLAGS = -march=i686
CMAKE = $(OMDEV)/bin/cmake/bin/cmake
CMAKE_TARGET = "MSYS Makefiles"
DBUS_INCLUDE_DIR = $(OMDEV)/lib/dbus-1.6.0-win32/include/
DBUS_INCLUDE_LIB_DIR = $(OMDEV)/lib/dbus-1.6.0-win32/lib/
DBUS_PATH = $(OMDEV)/lib/dbus-1.6.0-win32/
BOOST_PATH = $(OMDEV)/lib/3rdParty/boost-1_55/
PKG_CONFIG_PATH = $(OMDEV)/lib/gtk+-2.24.10/bin/
OSG_PATH = $(OMDEV)/lib/openscenegraph-2.8.3-mingw/
OPENCL = Yes
LINK = cp -rl
AR = ar
# LIBGC configuration is different for Windows (this file) and Linux (Makefile.in)
LIBGC_EXTRA_CONFIGURATION=--enable-threads=posix --enable-munmap=1 --disable-parallel-mark
MSL321_CONFIG_EXTRA_FLAGS=--enable-static --disable-shared
LIBFMILIB=libfmilib.a
LIBCMINPACKLIB=libcminpack.a
MODELICA_SPEC_PLATFORM=win32
SHREXT=.dll
IPOPT_TARGET=ipopt
UMFPACK_TARGET=umfpack
UMFPACK_SHARED=OFF
LD_LAPACK=-llapack -lblas
GRAPHLIB=libmetis.a
GRAPHINCLUDE=3rdParty/metis-5.1.0/include/ -DUSE_METIS -DUSE_GRAPH
BOOTSTRAP_FMIL_DEP=fmil
IDLPYTHON = $(OMDEV)/lib/omniORB-4.1.6-msvc-10/bin/x86_win32/omniidl -bpython -Wbglobal=_OMCIDL -Wbpackage=OMPythonIDL
IDLPYTHONTARGET = $(builddir_share)/omc/scripts/PythonInterface/OMPythonIDL/omc_communication_idl.py
IDLFILE=$(top_builddir)/Compiler/runtime/omc_communication.idl
LIB_OMC=lib/omc
LIBMODELICAEXTERNALC=$(OMBUILDDIR)/lib/omc/libModelicaExternalC.a
LIBMODELICASTANDARDTABLES=$(OMBUILDDIR)/lib/omc/libModelicaStandardTables.a
defaultMakefileTarget = Makefile.omdev.mingw
MAKEFILE_BOOT = LinkMain.makefile.mingw
include Makefile.common
# For Windows build static FMI lib!
FMILIB_SHARED = OFF
# For Windows build static CMinpack lib!
CMINPACKLIB_SHARED = OFF
CONFIG_REVISION = $(shell git describe --match "v*.*" --always)
revision:
test ! -e .git || cp -puf common/pre-commit.sh `git rev-parse --git-dir`/hooks/pre-commit
@echo Current revision: $(CONFIG_REVISION)
ifeq ($(CONFIG_REVISION),)
@if test -f revision.h; \
then echo Could not retrieve revision number. revision.h not updated; \
else echo "" > revision.h; echo Could not retrieve revision number. empty revision.h was created; \
fi;
else # revision is not empty, update it if it changed
@if test -f revision.h; \
then \
echo "#define CONFIG_REVISION \"$(CONFIG_REVISION)\"" > revision.h.tmp; diff revision.h revision.h.tmp > /dev/null; \
if [ $$? -eq 0 ]; then echo No change in revision; rm revision.h.tmp; \
else echo Revision has changed. updating revision.h; \mv revision.h.tmp revision.h; touch Compiler/runtime/omc_config.h; \
fi; \
else \
echo "#define CONFIG_REVISION \"$(CONFIG_REVISION)\"" > revision.h; echo Retrieved revision number. revision.h was created; \
fi;
endif
.testvariables: revision
ifndef OMDEV
@echo You have to set the OMDEV variabile pointing to your OMDev package root! Exiting....
@echo Take the OMDev package from: http://www.ida.liu.se/~adrpo/omc/omdev/
@echo For questions or problems email Adrian Pop, [email protected]
ABORT Please Define OMDEV
endif
settings:
@echo Building OMC using OMDev with the following settings...
@echo Using OMDev: $(OMDEV)
@echo Using Files: $(OMC_BUILD_FROM)
@echo Using Path : '$(PATH)'
@echo Current directory: `pwd`
@echo Building in OMBUILDDIR: $(OMBUILDDIR)
which gcc
# on windows run also msvc test
testlogwindows:
(time $(MAKE) -C testsuite -f Makefile 2>&1 | tee testsuite/testsuite-trace.txt) || true
(time $(MAKE) -C testsuite/openmodelica/cruntime/msvc/ -f Makefile >> testsuite/testsuite-trace.txt 2>&1) || true
(export RTEST_OMCFLAGS=+target=msvc ; time $(MAKE) -C testsuite/openmodelica/cppruntime/ -f Makefile >> testsuite/testsuite-trace.txt 2>&1) || true
echo "log is in testsuite/testsuite-trace.txt"
fgrep -v "... ok" testsuite/testsuite-trace.txt
echo "Successful tests: "
cat testsuite/testsuite-trace.txt | grep "... ok" | wc -l
echo "Failed models: "
cat testsuite/testsuite-trace.txt | grep "==== Log" | wc -l
cat testsuite/testsuite-trace.txt | grep "==== Log" ; echo DONE!
omdev_extra_dlls: install-openturns
echo Copying needed .dlls to the $(OMBUILDDIR)/bin directory
(cp -puf $(OMDEV)/tools/mingw/bin/libintl-8.dll $(builddir_bin)/)
(cp -puf $(OMDEV)/tools/mingw/bin/libiconv-2.dll $(builddir_bin)/)
(cp -puf $(OMDEV)/lib/omniORB-4.1.6-msvc-10/bin/x86_win32/omniORB416_vc10_rt.dll $(builddir_bin)/)
(cp -puf $(OMDEV)/lib/omniORB-4.1.6-msvc-10/bin/x86_win32/omnithread34_vc10_rt.dll $(builddir_bin)/)
(cp -puf $(OMDEV)/lib/pthread/pthreadGC2.dll $(builddir_bin)/)
(cp -puf $(OMDEV)/tools/mingw/bin/libgomp-1.dll $(builddir_bin)/)
(cp -puf $(OMDEV)/tools/mingw/bin/libgfortran-3.dll $(builddir_bin)/)
(cp -puf $(OMDEV)/tools/mingw/lib/libregex.a $(builddir_lib)/omc)
(cp -pf $(OMDEV)/lib/mico-msys-mingw/static/libmico2313.a $(builddir_lib)/omc/)
(cp -pf $(OMDEV)/lib/mico-msys-mingw/mico2313.dll $(builddir_bin)/)
(cp -pf $(OMDEV)/lib/expat-win32-msvc/libexpat.dll $(builddir_bin)/)
(cp -pf $(OMDEV)/lib/lapack-win32-msvc/blas_win32_MT.dll $(builddir_bin)/)
(cp -pf $(OMDEV)/lib/lapack-win32-msvc/lapack_win32_MT.dll $(builddir_bin)/)
mkdir -p $(builddir_lib)/omc/libexec/
(cp -pufr $(OMDEV)/tools/xsltproc $(builddir_lib)/omc/libexec/)
(cp -pufr $(OMDEV)/tools/gnuplot $(builddir_lib)/omc/libexec/)
(cp -puf $(OMDEV)/lib/3rdParty/Sundials/lib/release/mingw/libsundials_kinsol.a $(builddir_lib)/omc/)
(cp -puf $(OMDEV)/lib/3rdParty/Sundials/lib/release/mingw/libsundials_nvecserial.a $(builddir_lib)/omc/)
(cp -puf $(OMDEV)/lib/lis/liblis.la $(builddir_lib)/omc/)
(cp -puf $(OMDEV)/lib/lis/liblis.a $(builddir_lib)/omc/)
copycppheader:
echo Copying needed header files to the $(OMBUILDDIR)/include/omc/cpp directory
(cp -pufr $(OMDEV)/lib/3rdParty/Sundials/include $(OMBUILDDIR)/include/omc/cpp)
(mkdir -p $(OMBUILDDIR)/include/omc/cpp/boost)
(cp -puf $(BOOST_PATH)/boost/*.hpp $(OMBUILDDIR)/include/omc/cpp/boost)
(cp -pufr $(BOOST_PATH)/boost/algorithm $(OMBUILDDIR)/include/omc/cpp/boost)
(cp -pufr $(BOOST_PATH)/boost/archive $(OMBUILDDIR)/include/omc/cpp/boost)
(cp -pufr $(BOOST_PATH)/boost/assign $(OMBUILDDIR)/include/omc/cpp/boost)
(cp -pufr $(BOOST_PATH)/boost/atomic $(OMBUILDDIR)/include/omc/cpp/boost)
(cp -pufr $(BOOST_PATH)/boost/bind $(OMBUILDDIR)/include/omc/cpp/boost)
(cp -pufr $(BOOST_PATH)/boost/circular_buffer $(OMBUILDDIR)/include/omc/cpp/boost)
(cp -pufr $(BOOST_PATH)/boost/chrono $(OMBUILDDIR)/include/omc/cpp/boost)
(cp -pufr $(BOOST_PATH)/boost/concept $(OMBUILDDIR)/include/omc/cpp/boost)
(cp -pufr $(BOOST_PATH)/boost/config $(OMBUILDDIR)/include/omc/cpp/boost)
(cp -pufr $(BOOST_PATH)/boost/container $(OMBUILDDIR)/include/omc/cpp/boost)
(cp -pufr $(BOOST_PATH)/boost/detail $(OMBUILDDIR)/include/omc/cpp/boost)
(cp -pufr $(BOOST_PATH)/boost/exception $(OMBUILDDIR)/include/omc/cpp/boost)
(cp -pufr $(BOOST_PATH)/boost/date_time $(OMBUILDDIR)/include/omc/cpp/boost)
(cp -pufr $(BOOST_PATH)/boost/filesystem $(OMBUILDDIR)/include/omc/cpp/boost)
(cp -pufr $(BOOST_PATH)/boost/format $(OMBUILDDIR)/include/omc/cpp/boost)
(cp -pufr $(BOOST_PATH)/boost/function $(OMBUILDDIR)/include/omc/cpp/boost)
(cp -pufr $(BOOST_PATH)/boost/functional $(OMBUILDDIR)/include/omc/cpp/boost)
(cp -pufr $(BOOST_PATH)/boost/integer $(OMBUILDDIR)/include/omc/cpp/boost)
(cp -pufr $(BOOST_PATH)/boost/intrusive $(OMBUILDDIR)/include/omc/cpp/boost)
(cp -pufr $(BOOST_PATH)/boost/io $(OMBUILDDIR)/include/omc/cpp/boost)
(cp -pufr $(BOOST_PATH)/boost/iterator $(OMBUILDDIR)/include/omc/cpp/boost)
(cp -pufr $(BOOST_PATH)/boost/math $(OMBUILDDIR)/include/omc/cpp/boost)
(cp -pufr $(BOOST_PATH)/boost/move $(OMBUILDDIR)/include/omc/cpp/boost)
(cp -pufr $(BOOST_PATH)/boost/mpl $(OMBUILDDIR)/include/omc/cpp/boost)
(cp -pufr $(BOOST_PATH)/boost/multi_array $(OMBUILDDIR)/include/omc/cpp/boost)
(cp -pufr $(BOOST_PATH)/boost/numeric $(OMBUILDDIR)/include/omc/cpp/boost)
(cp -pufr $(BOOST_PATH)/boost/optional $(OMBUILDDIR)/include/omc/cpp/boost)
(cp -pufr $(BOOST_PATH)/boost/predef $(OMBUILDDIR)/include/omc/cpp/boost)
(cp -pufr $(BOOST_PATH)/boost/preprocessor $(OMBUILDDIR)/include/omc/cpp/boost)
(cp -pufr $(BOOST_PATH)/boost/program_options $(OMBUILDDIR)/include/omc/cpp/boost)
(cp -pufr $(BOOST_PATH)/boost/ptr_container $(OMBUILDDIR)/include/omc/cpp/boost)
(cp -pufr $(BOOST_PATH)/boost/range $(OMBUILDDIR)/include/omc/cpp/boost)
(cp -pufr $(BOOST_PATH)/boost/serialization $(OMBUILDDIR)/include/omc/cpp/boost)
(cp -pufr $(BOOST_PATH)/boost/smart_ptr $(OMBUILDDIR)/include/omc/cpp/boost)
(cp -pufr $(BOOST_PATH)/boost/system $(OMBUILDDIR)/include/omc/cpp/boost)
(cp -pufr $(BOOST_PATH)/boost/ratio $(OMBUILDDIR)/include/omc/cpp/boost)
(cp -pufr $(BOOST_PATH)/boost/thread $(OMBUILDDIR)/include/omc/cpp/boost)
(cp -pufr $(BOOST_PATH)/boost/tuple $(OMBUILDDIR)/include/omc/cpp/boost)
(cp -pufr $(BOOST_PATH)/boost/type_traits $(OMBUILDDIR)/include/omc/cpp/boost)
(cp -pufr $(BOOST_PATH)/boost/typeof $(OMBUILDDIR)/include/omc/cpp/boost)
(cp -pufr $(BOOST_PATH)/boost/unordered $(OMBUILDDIR)/include/omc/cpp/boost)
(cp -pufr $(BOOST_PATH)/boost/utility $(OMBUILDDIR)/include/omc/cpp/boost)
omc: mkbuilddirs interactive fmil omdev_extra_dlls breakprocess opencl_rt CMinpack metis Cdaskr $(IPOPT_TARGET) graphstream
(time $(MAKE) -f $(defaultMakefileTarget) CFLAGS="$(CFLAGS)" omc-bootstrapped OMBUILDDIR=$(OMBUILDDIR))
boehm-gc-lib: $(OMBUILDDIR)/lib/omc/libomcgc.a
fmil_msvc:
rm -f $(OMBUILDDIR)/lib/omc/msvc/fmil*
rm -rf 3rdParty/FMIL/install_msvc
mkdir -p $(OMBUILDDIR)/lib/omc/msvc/
# Goto build msvc directory
test -d 3rdParty/FMIL
rm -rf 3rdParty/FMIL/build_msvc
mkdir -p 3rdParty/FMIL/build_msvc
# Create batch file, that builds with CMake and Visual Studio
test -f """${VS100COMNTOOLS}/../../VC/vcvarsall.bat"""
echo 'Building CMinpack with MSVC'
echo @echo on > 3rdParty/FMIL/build_msvc/build.bat
echo call '"%VS100COMNTOOLS%\\..\\..\\VC\\vcvarsall.bat"' >> 3rdParty/FMIL/build_msvc/build.bat
echo echo Calling CMake >> 3rdParty/FMIL/build_msvc/build.bat
echo '%OMDEV%\\bin\\cmake\\bin\\cmake -DCMAKE_VERBOSE_MAKEFILE:Bool=ON -DFMILIB_BUILD_TESTS=OFF -DFMILIB_BUILD_STATIC_LIB=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo -DFMILIB_INSTALL_PREFIX=../install_msvc ../ -G "NMake Makefiles"' >> 3rdParty/FMIL/build_msvc/build.bat
echo @echo on >> 3rdParty/FMIL/build_msvc/build.bat
echo set MAKE= >> 3rdParty/FMIL/build_msvc/build.bat
echo set MAKEFLAGS= >> 3rdParty/FMIL/build_msvc/build.bat
echo echo Building FMIL_msvc >> 3rdParty/FMIL/build_msvc/build.bat
echo nmake /f Makefile install >> 3rdParty/FMIL/build_msvc/build.bat
# Change into directory and run batch file
cd ./3rdParty/FMIL/build_msvc; echo "change to 3rdParty/FMIL/build_msvc";\
cmd /c build.bat
# copy dll to bin folder
(cp -puf 3rdParty/FMIL/install_msvc/lib/fmilib_shared.dll $(OMBUILDDIR)/bin/fmilib.dll)
(cp -puf 3rdParty/FMIL/install_msvc/lib/fmilib_shared.dll $(OMBUILDDIR)/lib/omc/msvc/fmilib.dll)
(cp -puf 3rdParty/FMIL/install_msvc/lib/fmilib_shared.lib $(OMBUILDDIR)/lib/omc/msvc/fmilib.lib)
# copy the dll with the actual name: fmilib_shared.dll as the fmilib.lib contains that name and the exe will look for it
(cp -puf 3rdParty/FMIL/install_msvc/lib/fmilib_shared.dll $(OMBUILDDIR)/bin/fmilib_shared.dll)
(cp -puf 3rdParty/FMIL/install_msvc/lib/fmilib_shared.dll $(OMBUILDDIR)/lib/omc/msvc/fmilib_shared.dll)
(cp -puf 3rdParty/FMIL/install_msvc/lib/fmilib_shared.lib $(OMBUILDDIR)/lib/omc/msvc/fmilib_shared.lib)
CMinpack_msvc:
rm -f $(OMBUILDDIR)/lib/omc/msvc/cminpack.*
rm -rf 3rdParty/CMinpack/build_msvc
rm -rf 3rdParty/CMinpack/install_msvc
mkdir -p $(OMBUILDDIR)/lib/omc/msvc/
# Goto build msvc directory
test -d 3rdParty/CMinpack
mkdir -p 3rdParty/CMinpack/build_msvc
# Create batch file, that builds with CMake and Visual Studio
test -f """${VS100COMNTOOLS}/../../VC/vcvarsall.bat"""
echo 'Building CMinpack with MSVC'
echo @echo on > 3rdParty/CMinpack/build_msvc/build.bat
echo call '"%VS100COMNTOOLS%\\..\\..\\VC\\vcvarsall.bat"' >> 3rdParty/CMinpack/build_msvc/build.bat
echo echo Calling CMake >> 3rdParty/CMinpack/build_msvc/build.bat
echo '%OMDEV%\\bin\\cmake\\bin\\cmake -DCMAKE_VERBOSE_MAKEFILE:Bool=ON -DSHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=../install_msvc ../ -G "NMake Makefiles"' >> 3rdParty/CMinpack/build_msvc/build.bat
echo echo Building CMinpack >> 3rdParty/CMinpack/build_msvc/build.bat
echo @echo on >> 3rdParty/CMinpack/build_msvc/build.bat
echo set MAKE= >> 3rdParty/CMinpack/build_msvc/build.bat
echo set MAKEFLAGS= >> 3rdParty/CMinpack/build_msvc/build.bat
echo nmake /f Makefile install >> 3rdParty/CMinpack/build_msvc/build.bat
# Change into directory and run batch file
cd ./3rdParty/CMinpack/build_msvc; echo "change to 3rdParty/CMinpack/build_msvc";\
cmd /c build.bat
# copy dll to bin folder
(cp -puf 3rdParty/CMinpack/install_msvc/lib/cminpack.lib $(OMBUILDDIR)/lib/omc/msvc/)
Umfpack_msvc:
rm -f $(OMBUILDDIR)/lib/omc/msvc/amd.lib
rm -f $(OMBUILDDIR)/lib/omc/msvc/umfpack.lib
rm -rf $(OMBUILDDIR)/include/omc/msvc/suitesparse
rm -rf 3rdParty/SuiteSparse/build_msvc
rm -rf 3rdParty/SuiteSparse/install_msvc
mkdir -p $(OMBUILDDIR)/lib/omc/msvc/
# Goto build msvc directory
test -d 3rdParty/SuiteSparse
mkdir -p 3rdParty/SuiteSparse/build_msvc
# Create batch file, that builds with CMake and Visual Studio
test -f """${VS100COMNTOOLS}/../../VC/vcvarsall.bat"""
echo 'Building Umfpack with MSVC'
echo @echo on > 3rdParty/SuiteSparse/build_msvc/build.bat
echo call '"%VS100COMNTOOLS%\\..\\..\\VC\\vcvarsall.bat"' >> 3rdParty/SuiteSparse/build_msvc/build.bat
echo echo Calling CMake >> 3rdParty/SuiteSparse/build_msvc/build.bat
echo '%OMDEV%\\bin\\cmake\\bin\\cmake -DCMAKE_VERBOSE_MAKEFILE:Bool=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=../install_msvc ../ -G "NMake Makefiles"' >> 3rdParty/SuiteSparse/build_msvc/build.bat
echo echo Building Umfpack >> 3rdParty/SuiteSparse/build_msvc/build.bat
echo @echo on >> 3rdParty/SuiteSparse/build_msvc/build.bat
echo set MAKE= >> 3rdParty/SuiteSparse/build_msvc/build.bat
echo set MAKEFLAGS= >> 3rdParty/SuiteSparse/build_msvc/build.bat
echo nmake /f Makefile install >> 3rdParty/SuiteSparse/build_msvc/build.bat
# Change into directory and run batch file
cd ./3rdParty/SuiteSparse/build_msvc; echo "change to 3rdParty/SuiteSparse/build_msvc";\
cmd /c build.bat
# copy dll to bin folder
(mkdir -p $(OMBUILDDIR)/include/omc/msvc/suitesparse)
(cp -puf 3rdParty/SuiteSparse/install_msvc/lib/omc/*.lib $(OMBUILDDIR)/lib/omc/msvc/)
(cp -pur 3rdParty/SuiteSparse/install_msvc/include/omc/c/suitesparse/Include/ $(OMBUILDDIR)/include/omc/msvc/suitesparse)
runtimeCPPmsvcinstall: mkbuilddirs CMinpack_msvc copycppheader
$(MAKE) -C SimulationRuntime/cpp/ -f Makefile.omdev.mingw runtimeCPPmsvc OMBUILDDIR=$(OMBUILDDIR)
# mkdir -p $(OMBUILDDIR)/lib/omc/msvc/ && cp -p ${OMDEV}/lib/3rdParty/Sundials/lib/release/vc100/*.lib $(OMBUILDDIR)/lib/omc/msvc/
cp -p ${OMDEV}/lib/3rdParty/Sundials/lib/release/vc100/*.dll $(OMBUILDDIR)/bin/
cp -p $(BOOST_PATH)/lib/*vc*.dll $(OMBUILDDIR)/bin/
cp -p $(BOOST_PATH)/lib/*vc*.lib $(OMBUILDDIR)/lib/omc/cpp/msvc
simulationruntimecmsvc: mkbuilddirs Umfpack_msvc CMinpack_msvc fmil_msvc
test -f """${VS100COMNTOOLS}/../../VC/vcvarsall.bat"""
mkdir -p $(OMBUILDDIR)/include/omc/msvc/
mkdir -p $(OMBUILDDIR)/lib/omc/msvc/debug
mkdir -p $(OMBUILDDIR)/lib/omc/msvc/release
echo 'Build the MSVC RELEASE'
mkdir -p SimulationRuntime/build_c
echo @echo on > SimulationRuntime/build_c/build.bat
echo call '"%VS100COMNTOOLS%\\..\\..\\VC\\vcvarsall.bat"' >> SimulationRuntime/build_c/build.bat
echo '%OMDEV%\\bin\\cmake\\bin\\cmake -DCMAKE_VERBOSE_MAKEFILE:Bool=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:String=../../build ../c -G "NMake Makefiles"' >> SimulationRuntime/build_c/build.bat
echo @echo on >> SimulationRuntime/build_c/build.bat
echo set MAKE= >> SimulationRuntime/build_c/build.bat
echo set MAKEFLAGS= >> SimulationRuntime/build_c/build.bat
echo nmake /f Makefile >> SimulationRuntime/build_c/build.bat
cd SimulationRuntime/build_c && cmd /c build.bat
echo 'Copy the .lib files (needed for compilation) and .pdb files (needed for debugging) to $(OMBUILDDIR)/lib/omc'
(cd SimulationRuntime/build_c/ && find . -type f -path "*.lib" -exec cp {} $(OMBUILDDIR)/lib/omc/msvc/release/. \;)
(cd SimulationRuntime/build_c/ && find . -type f -path "*.pdb" -exec cp {} $(OMBUILDDIR)/lib/omc/msvc/release/. \;)
rm -rf SimulationRuntime/build_c/
echo 'Build the MSVC DEBUG'
mkdir -p SimulationRuntime/build_debug_c
echo @echo on > SimulationRuntime/build_debug_c/build.bat
echo call '"%VS100COMNTOOLS%\\..\\..\\VC\\vcvarsall.bat"' >> SimulationRuntime/build_debug_c/build.bat
echo '%OMDEV%\\bin\\cmake\\bin\\cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX:String=../../build_debug ../c -G "NMake Makefiles"' >> SimulationRuntime/build_debug_c/build.bat
echo @echo on >> SimulationRuntime/build_debug_c/build.bat
echo set MAKE= >> SimulationRuntime/build_debug_c/build.bat
echo set MAKEFLAGS= >> SimulationRuntime/build_debug_c/build.bat
echo nmake /f Makefile >> SimulationRuntime/build_debug_c/build.bat
cd SimulationRuntime/build_debug_c && cmd /c build.bat
echo 'Copy the .lib files (needed for compilation) and .pdb files (needed for debugging) to $(OMBUILDDIR)/lib/omc'
(cd SimulationRuntime/build_debug_c/ && find . -type f -path "*.lib" -exec cp {} $(OMBUILDDIR)/lib/omc/msvc/debug/. \;)
(cd SimulationRuntime/build_debug_c/ && find . -type f -path "*.pdb" -exec cp {} $(OMBUILDDIR)/lib/omc/msvc/debug/. \;)
rm -rf SimulationRuntime/build_debug_c/
echo 'Copy the needed .lib/.dll files from OMDev to $(OMBUILDDIR)/lib/omc'
cp -p ${OMDEV}/lib/libf2c/*.lib $(OMBUILDDIR)/lib/omc/msvc/release/
cp -p ${OMDEV}/lib/libf2c/debug/*.lib $(OMBUILDDIR)/lib/omc/msvc/debug/
cp -p ${OMDEV}/lib/3rdParty/Sundials/lib/release/vc100/*.lib $(OMBUILDDIR)/lib/omc/msvc/
cp -p ${OMDEV}/lib/expat-win32-msvc/*.lib $(OMBUILDDIR)/lib/omc/msvc/
cp -p ${OMDEV}/lib/3rdParty/Sundials/lib/release/vc100/*.dll $(OMBUILDDIR)/bin/
cp -p ${OMDEV}/lib/lapack-win32-msvc/*.lib $(OMBUILDDIR)/lib/omc/msvc/
cp -p $(OMDEV)/lib/lis/*.lib $(OMBUILDDIR)/lib/omc/msvc/
cp -p $(OMDEV)/lib/pthread/*.* $(OMBUILDDIR)/lib/omc/msvc/
cp -p $(OMDEV)/include/pthread/*.* $(OMBUILDDIR)/include/omc/msvc/
echo 'Copy the needed .dll files from OMDev to $(OMBUILDDIR)/omc'
cp -p $(OMDEV)/lib/pthread/pthreadV*.dll $(OMBUILDDIR)/bin/
# build gc as well, as it is needed for the msvc c runtime
echo 'Build gc (RelWithDebInfo)'
mkdir -p 3rdParty/gc/build_msvc
echo @echo on > 3rdParty/gc/build_msvc/build.bat
echo call '"%VS100COMNTOOLS%\\..\\..\\VC\\vcvarsall.bat"' >> 3rdParty/gc/build_msvc/build.bat
echo '%OMDEV%\\bin\\cmake\\bin\\cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ../ -G "NMake Makefiles"' >> 3rdParty/gc/build_msvc/build.bat
echo @echo on >> 3rdParty/gc/build_msvc/build.bat
echo set MAKE= >> 3rdParty/gc/build_msvc/build.bat
echo set MAKEFLAGS= >> 3rdParty/gc/build_msvc/build.bat
echo nmake /f Makefile >> 3rdParty/gc/build_msvc/build.bat
cd 3rdParty/gc/build_msvc && cmd /c build.bat
echo 'Copy the .lib files (needed for compilation) and .pdb files (needed for debugging) to $(OMBUILDDIR)/lib/omc/msvc/'
cp -u 3rdParty/gc/build_msvc/gc-lib.* $(OMBUILDDIR)/lib/omc/msvc/
rm -rf 3rdParty/gc/build_msvc/
omc-bootstrapped:
$(MAKE) -f $(defaultMakefileTarget) CFLAGS="$(CFLAGS)" OMBUILDDIR=$(OMBUILDDIR) bootstrap-dependencies sim-dependencies
$(MAKE) -f $(defaultMakefileTarget) -C Compiler/boot CFLAGS="$(CFLAGS)" OMBUILDDIR=$(OMBUILDDIR)
modelica3d:
cd 3rdParty/modelica3d && mkdir -p build
cd 3rdParty/modelica3d/build && $(CMAKE) -DCMAKE_COLOR_MAKEFILE:Bool=OFF -DOSG_BACKEND=1 -DDBUS_INCLUDE_DIR=$(DBUS_INCLUDE_DIR) -DDBUS_INCLUDE_LIB_DIR=$(DBUS_INCLUDE_LIB_DIR) -DDBUS_LIBRARY=$(DBUS_PATH) -DBOOST_ROOT=$(BOOST_PATH) -DCMAKE_PREFIX_PATH=$(OSG_PATH) -DCMAKE_PROGRAM_PATH=$(PKG_CONFIG_PATH) -DUSE_OMC=0 .. -G $(CMAKE_TARGET)
$(MAKE) -C 3rdParty/modelica3d/build
cp -p 3rdParty/modelica3d/build/lib/modcount/libmodcount.a 3rdParty/modelica3d/build/lib/modbus/libmodbus.a $(OMBUILDDIR)/lib/omc/
mkdir -p $(OMBUILDDIR)/lib/omlibrary-modelica3d/blender2.59 $(OMBUILDDIR)/lib/omlibrary-modelica3d/osg-gtk/dbus-python/etc
# copy the dbus static lib required during the simulation
cp -rp $(OMDEV)/lib/dbus-1.6.0-win32/bin/libdbus-1.a $(OMBUILDDIR)/lib/omc/
cp -p 3rdParty/modelica3d/examples/multibody/src/modelica/*.mo $(OMBUILDDIR)/lib/omlibrary-modelica3d/
cp -p 3rdParty/modelica3d/backends/blender2.59/dbus-server.py $(OMBUILDDIR)/lib/omlibrary-modelica3d/blender2.59/
cp -p 3rdParty/modelica3d/backends/osg-gtk/python/dbus-server.py $(OMBUILDDIR)/lib/omlibrary-modelica3d/osg-gtk/
# copy the dbus-python bindings binaries required by osg-gtk python script
cp -rp $(OMDEV)/lib/dbus-python-1.1.1/lib/site-packages/* $(OMBUILDDIR)/lib/omlibrary-modelica3d/osg-gtk/dbus-python/
cp -rp $(OMDEV)/lib/dbus-python-1.1.1/bin/* $(OMBUILDDIR)/lib/omlibrary-modelica3d/osg-gtk/dbus-python/
cp -rp $(OMDEV)/lib/dbus-python-1.1.1/etc/* $(OMBUILDDIR)/lib/omlibrary-modelica3d/osg-gtk/dbus-python/etc
# copy the required gtk binaries
cp -p -u $(OMDEV)/lib/gtk+-2.24.10/bin/*.dll $(OMBUILDDIR)/lib/omlibrary-modelica3d/osg-gtk/
# copy the required modelica3D binaries
cp -p 3rdParty/modelica3d/build/backends/osg-gtk/libm3d-osg-gtk.* 3rdParty/modelica3d/build/lib/proc3d/libproc3d.* $(OMBUILDDIR)/lib/omlibrary-modelica3d/osg-gtk/
# copy the required osg binaries
mkdir -p $(OMBUILDDIR)/lib/omlibrary-modelica3d/osg-gtk/osgPlugins-2.8.3
cp -p -u $(OMDEV)/lib/openscenegraph-2.8.3-mingw/bin/*.dll $(OMBUILDDIR)/lib/omlibrary-modelica3d/osg-gtk/
cp -p -u $(OMDEV)/lib/openscenegraph-2.8.3-mingw/bin/osgPlugins-2.8.3/*.dll $(OMBUILDDIR)/lib/omlibrary-modelica3d/osg-gtk/osgPlugins-2.8.3/
# Empty; only Unix version uses QT makefiles, etc...
qtclean:
qwt:
$(MAKE) -C 3rdParty/qwt -f Makefile.omdev.mingw
test -f $(builddir_inc)/qwt/qwt_global.h || ($(MAKE) -C 3rdParty/qwt -f Makefile.omdev.mingw install && cp -a 3rdParty/qwt/build/include/*.h $(builddir_inc)/qwt)
omplot: qwt
$(MAKE) -C OMPlot/OMPlotGUI -f Makefile.omdev.mingw
omedit: omplot qjson
$(MAKE) -C OMEdit/OMEditGUI -f Makefile.omdev.mingw
omnotebook: omplot
$(MAKE) -C OMNotebook/OMNotebookGUI -f Makefile.omdev.mingw
omshell:
$(MAKE) -C OMShell/OMShellGUI -f Makefile.omdev.mingw
omvisualize:
$(MAKE) -C OMVisualize/OMVisualizeGUI -f Makefile.omdev.mingw
omoptimbasis: omplot
$(MAKE) -C OMOptimBasis/build -f Makefile.omdev.mingw
omoptim: omoptimbasis
$(MAKE) -C OMOptim/build -f Makefile.omdev.mingw
qtclients: omplot omedit omshell omvisualize omoptim omnotebook
clean-qtclients:
$(MAKE) -C 3rdParty/qwt -f Makefile.omdev.mingw clean
rm -f $(OMBUILDDIR)/bin/OMPlot.exe $(OMBUILDDIR)/bin/OMVisualize.exe $(OMBUILDDIR)/bin/OMEdit.exe $(OMBUILDDIR)/bin/OMNotebook.exe $(OMBUILDDIR)/bin/OMShell.exe $(OMBUILDDIR)/bin/OMOptim.exe
rm -f $(OMBUILDDIR)/lib/libOMPlot.a $(OMBUILDDIR)/lib/libOMVisualize.a $(OMBUILDDIR)/lib/libOMOptimBasis.a $(OMBUILDDIR)/lib/libOMOptim.a
rm -rf $(OMBUILDDIR)/share/omedit* $(OMBUILDDIR)/share/omnotebook* $(OMBUILDDIR)/share/omshell*
$(MAKE) -C OMPlot/OMPlotGUI -f Makefile.omdev.mingw clean
$(MAKE) -C OMVisualize/OMVisualizeGUI -f Makefile.omdev.mingw clean
$(MAKE) -C OMEdit/OMEditGUI -f Makefile.omdev.mingw clean
$(MAKE) -C OMNotebook/OMNotebookGUI -f Makefile.omdev.mingw clean
$(MAKE) -C OMShell/OMShellGUI -f Makefile.omdev.mingw clean
$(MAKE) -C OMOptimBasis/build -f Makefile.omdev.mingw clean
$(MAKE) -C OMOptim/build -f Makefile.omdev.mingw clean
lis:
lis-clean:
install-python: $(IDLPYTHONTARGET)
.PHONY: script-files-python
script-files-python: mkbuilddirs-python
# copy library files neeeded by OMPython
(cp -puf $(OMDEV)/lib/omniORB-4.1.6-msvc-10/lib/x86_win32/_omnipy.pyd $(builddir_lib)/python)
(cp -puf $(OMDEV)/lib/omniORB-4.1.6-msvc-10/lib/python/omniORB/__init__.py $(builddir_lib)/python/omniORB/)
(cp -puf $(OMDEV)/lib/omniORB-4.1.6-msvc-10/lib/python/omniORB/boxes_idl.py $(builddir_lib)/python/omniORB/)
(cp -puf $(OMDEV)/lib/omniORB-4.1.6-msvc-10/lib/python/omniORB/CORBA.py $(builddir_lib)/python/omniORB/)
(cp -puf $(OMDEV)/lib/omniORB-4.1.6-msvc-10/lib/python/omniORB/corbaidl_idl.py $(builddir_lib)/python/omniORB/)
(cp -puf $(OMDEV)/lib/omniORB-4.1.6-msvc-10/lib/python/omniORB/minorCodes.py $(builddir_lib)/python/omniORB/)
(cp -puf $(OMDEV)/lib/omniORB-4.1.6-msvc-10/lib/python/omniORB/PortableServer.py $(builddir_lib)/python/omniORB/)
(cp -puf $(OMDEV)/lib/omniORB-4.1.6-msvc-10/lib/python/omniORB/tcInternal.py $(builddir_lib)/python/omniORB/)
# copy OMPython files
cp -rfp OMPython/setup.py $(builddir_share)/omc/scripts/PythonInterface
cp -rfp OMPython/OMPython/* $(builddir_share)/omc/scripts/PythonInterface/OMPython
$(IDLPYTHONTARGET) : $(IDLFILE) script-files-python
$(IDLPYTHON) -C$(builddir_share)/omc/scripts/PythonInterface $(IDLFILE)
mkbuilddirs-python:
# create directories
mkdir -p $(builddir_lib)/python/omniORB
mkdir -p $(builddir_share)/omc/scripts/PythonInterface/OMPython/OMParser
clean-python:
rm -rf OMPython/build/ OMPython/OMPythonIDL/ OMPython/OMPython/_GlobalID* OMPython/OMPython/omc_communication_idl.py
.PRECIOUS: Makefile.omdev.mingw