/
Makefile.common
417 lines (349 loc) · 20.3 KB
/
Makefile.common
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
inclu.PHONY : all omc release mosh clean .testvariables mkbuilddirs qtclean qtclean-common omc-diff modelica3d
unexport PREFIX
top_builddir = .
builddir_app=$(top_builddir)/build/Applications/
builddir_bin=$(top_builddir)/build/bin
builddir_lib=$(top_builddir)/build/lib
builddir_inc=$(top_builddir)/build/include/omc
builddir_doc=$(top_builddir)/build/share/doc
builddir_share=$(top_builddir)/build/share/
builddir_man=$(top_builddir)/build/share/man/
builddir_java=$(top_builddir)/build/share/omc/java/
builddir_locale=$(top_builddir)/build/share/locale/
INSTALL_APPDIR = ${DESTDIR}/Applications/MacPorts/
INSTALL_BINDIR = ${DESTDIR}${bindir}
INSTALL_LIBDIR = ${DESTDIR}${libdir}/
INSTALL_INCLUDEDIR = ${DESTDIR}${includedir}/omc
INSTALL_DATADIR = ${DESTDIR}${datadir}
INSTALL_DOCDIR = ${DESTDIR}${docdir}
INSTALL_SHAREDIR = ${DESTDIR}${datadir}/
INSTALL_MANDIR = ${DESTDIR}${datadir}/man/
INSTALL_JAVADIR = ${DESTDIR}${datadir}/omc/java
INSTALL_LOCALEDIR = ${DESTDIR}${datadir}/locale
.PHONY : interactive omc release qtclients mosh all mkbuilddirs fmi test install-dirs susan susan_all susgen sustst install-python install-openturns runtimeCPPinstall CMinpack Cdaskr boehm-gc
mkbuilddirs:
if [ "$(APP)" = ".app" ]; then mkdir -p $(builddir_app); fi
mkdir -p $(builddir_bin)
mkdir -p $(builddir_lib)/omc/emcc
mkdir -p $(builddir_inc)/c/
mkdir -p $(builddir_inc)/c/linearization/
mkdir -p $(builddir_inc)/c/optimization/
mkdir -p $(builddir_inc)/c/simulation/
mkdir -p $(builddir_inc)/c/simulation/results/
mkdir -p $(builddir_inc)/c/simulation/solver/
mkdir -p $(builddir_inc)/c/simulation/solver/initialization/
mkdir -p $(builddir_inc)/c/meta/
mkdir -p $(builddir_inc)/c/meta/gc/
mkdir -p $(builddir_inc)/c/util/
mkdir -p $(builddir_inc)/c/fmi1/
mkdir -p $(builddir_inc)/c/fmi2/
mkdir -p $(builddir_java)
mkdir -p $(builddir_share)/omc/scripts/OpenTurns/
mkdir -p $(builddir_doc)/omc/testmodels
mkdir -p $(builddir_man)/man1/
release: omc-diff omc
bootstrap-dependencies: omc-diff interactive docs fmi fmil opencl_rt lis graphstream cjson
# NOTE: OpenModelicaBootstrappingHeader.h has to be regenerated without any other process writing to so/etc or you get bus errors
$(MAKE) -C Compiler OpenModelicaBootstrappingHeader.h
$(MAKE) -C Compiler/runtime install
$(MAKE) -C Compiler builtin install_scripts
$(MAKE) -C Parser install
install-python:
(time $(MAKE) -C PythonInterface -f $(defaultMakefileTarget))
install-openturns: mkbuilddirs
(time cp SimulationRuntime/OpenTurns/* $(builddir_share)/omc/scripts/OpenTurns/)
interactive: .testvariables mkbuilddirs boehm-gc fmil msl-external-libs lis Cdaskr CMinpack $(IPOPT_TARGET)
$(MAKE) -C SimulationRuntime/interactive -f $(defaultMakefileTarget)
# Depends on libinteractive.a
$(MAKE) -C SimulationRuntime/c -f $(defaultMakefileTarget)
docs: mkbuilddirs
$(MAKE) -C Compiler/Translation release
(cp -p doc/*.pdf doc/OpenModelicaAPI-Howto/*.pdf $(builddir_doc)/omc)
(cp -p Examples/*.* $(builddir_doc)/omc/testmodels/)
rm -f $(builddir_doc)/omc/testmodels/CMake*.txt
cp -p ./SimulationRuntime/interactive/README.txt $(builddir_doc)/omc/OpenModelica-InteractiveSimulation-README.txt
# man pages
(cd doc/manpages/ && for f in *.1; do cp -p $$f ../../$(builddir_man)/man1/ && gzip -f ../../$(builddir_man)/man1/$$f ; done)
GC_HEADERS=gc.h gc_allocator.h gc_amiga_redirects.h gc_backptr.h gc_config_macros.h gc_gcj.h gc_pthread_redirects.h
libgc-dev: /usr/include/gc/gc_inline.h
libgc-dev: /usr/include/gc/gc_mark.h
libgc-dev: /usr/include/gc/gc_pthread_redirects.h
libgc-dev: /usr/include/gc/gc_tiny_fl.h
libgc-dev: /usr/include/gc/gc_typed.h
libgc-dev: /usr/include/gc/gc_version.h
libgc-dev: /usr/include/gc/leak_detector.h
libgc-dev: /usr/include/gc/new_gc_alloc.h
libgc-dev: /usr/include/gc/weakpointer.h
boehm-gc: mkbuilddirs boehm-gc-lib build/include/omc/c/gc.h build/include/omc/c/gc_config_macros.h build/include/omc/c/gc_version.h build/include/omc/c/gc_pthread_redirects.h
build/lib/omc/libgc.a: 3rdParty/gc-7.2/.libs/libgc.a mkbuilddirs
cp -p $< $@
3rdParty/gc-7.2/.libs/libgc.a: 3rdParty/gc-7.2/Makefile
$(MAKE) -C 3rdParty/gc-7.2/
build/include/omc/c/gc.h: 3rdParty/gc-7.2/include/gc.h mkbuilddirs
cp -pPR $< $@
build/include/omc/c/gc_config_macros.h: 3rdParty/gc-7.2/include/gc_config_macros.h mkbuilddirs
cp -pPR $< $@
build/include/omc/c/gc_version.h: 3rdParty/gc-7.2/include/gc_version.h mkbuilddirs
cp -pPR $< $@
build/include/omc/c/gc_pthread_redirects.h: 3rdParty/gc-7.2/include/gc_pthread_redirects.h mkbuilddirs
cp -pPR $< $@
3rdParty/gc-7.2/Makefile: 3rdParty/gc-7.2/Makefile.in 3rdParty/gc-7.2/configure
(cd 3rdParty/gc-7.2 && ./configure "--host=$(host)" $(LIBGC_EXTRA_CONFIGURATION) --disable-gcj-support --disable-java-finalization --enable-large-config CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS) -DLARGE_CONFIG -DTHREAD_LOCAL_ALLOC")
3rdParty/Ipopt-3.11.6/Makefile: $(LAPACK_TARGET)
(cd 3rdParty/Ipopt-3.11.6 && ./configure --with-pic "CC=$(CC)" CXX="$(CXX)" F77="$(FC)" LDFLAGS="-L${abs_top_builddir}/build/lib/omc $(LDFLAGS)" --with-lapack="$(LD_LAPACK)" --with-blas="$(LD_LAPACK)" --without-metis)
build/lib/omc/libipopt.la: 3rdParty/Ipopt-3.11.6/Makefile
$(MAKE) -C 3rdParty/Ipopt-3.11.6
$(MAKE) -C 3rdParty/Ipopt-3.11.6 install
test ! `uname` = Darwin || install_name_tool -id @rpath/libipopt.1.9.6.dylib 3rdParty/Ipopt-3.11.6/lib/libipopt.1.9.6.dylib
test ! `uname` = Darwin || install_name_tool -id @rpath/libcoinmumps.1.4.11.dylib 3rdParty/Ipopt-3.11.6/lib/libcoinmumps.1.4.11.dylib
cp -a 3rdParty/Ipopt-3.11.6/lib*/*.* build/lib/omc
ipopt: build/lib/omc/libipopt.la
build/lib/omc/libopenblas_openmodelica.a:
$(MAKE) -C 3rdParty/OpenBLAS-0.2.8 CC="$(CC)" CXX="$(CXX)" FC="$(FC)" USE_THREAD=0 NO_LAPACKE=1 LIBNAMESUFFIX=openmodelica $(OPENBLAS_EXTRA_ARGS)
$(MAKE) -C 3rdParty/OpenBLAS-0.2.8 PREFIX=${abs_top_builddir}/build OPENBLAS_LIBRARY_DIR=${abs_top_builddir}/build/lib/omc OPENBLAS_INCLUDE_DIR=${abs_top_builddir}/3rdParty/build/install-includes/ NO_LAPACKE=1 LIBNAMESUFFIX=openmodelica install
openblas: build/lib/omc/libopenblas_openmodelica.a
opencl_rt:
ifeq ("$(OPENCL)","Yes")
$(MAKE) -C SimulationRuntime/ParModelica/explicit/openclrt -f $(defaultMakefileTarget)
endif
opencl_rt_clean:
$(MAKE) -C SimulationRuntime/ParModelica/explicit/openclrt -f $(defaultMakefileTarget) clean
breakprocess:
(cd testsuite/openmodelica/bootstrapping && time g++ BreakProcess.cpp -o BreakProcess -static-libgcc)
(cd testsuite/openmodelica/bootstrapping && cp BreakProcess.exe ../../../$(builddir_bin)/)
all-runtimeCPPinstall:
$(MAKE) msl-external-libs
$(MAKE) all runtimeCPPinstall
omc-and-runtimeCPPinstall: mkbuilddirs
$(MAKE) msl-external-libs
$(MAKE) omc runtimeCPPinstall
runtimeCPP: msl-external-libs CMinpack
$(MAKE) -C SimulationRuntime/cpp/ -f $(defaultMakefileTarget) CC="$(CC)" CXX="$(CXX)"
runtimeCPPinstall: msl-external-libs CMinpack
$(MAKE) -C SimulationRuntime/cpp/ -f $(defaultMakefileTarget) CC="$(CC)" CXX="$(CXX)" install
test ! `uname` = Darwin || install_name_tool -id @rpath/cpp/libOMCppCVode.dylib build/lib/omc/cpp/libOMCppCVode.dylib
test ! `uname` = Darwin || install_name_tool -id @rpath/cpp/libOMCppDataExchange.dylib build/lib/omc/cpp/libOMCppDataExchange.dylib
test ! `uname` = Darwin || install_name_tool -id @rpath/cpp/libOMCppEuler.dylib build/lib/omc/cpp/libOMCppEuler.dylib
test ! `uname` = Darwin || install_name_tool -id @rpath/cpp/libOMCppNewton.dylib build/lib/omc/cpp/libOMCppNewton.dylib
test ! `uname` = Darwin || install_name_tool -id @rpath/cpp/libOMCppSimulationSettings.dylib build/lib/omc/cpp/libOMCppSimulationSettings.dylib
test ! `uname` = Darwin || install_name_tool -id @rpath/cpp/libOMCppSolver.dylib build/lib/omc/cpp/libOMCppSolver.dylib
test ! `uname` = Darwin || install_name_tool -id @rpath/cpp/libOMCppSystem.dylib build/lib/omc/cpp/libOMCppSystem.dylib
test ! `uname` = Darwin || install_name_tool -change libOMCppSolver.dylib @rpath/cpp/libOMCppSolver.dylib build/lib/omc/cpp/libOMCppCVode.dylib
test ! `uname` = Darwin || install_name_tool -change libOMCppSolver.dylib @rpath/cpp/libOMCppSolver.dylib build/lib/omc/cpp/libOMCppEuler.dylib
omc-diff: mkbuilddirs
$(MAKE) -C testsuite/ -f Makefile omc-diff
testlibrariemsl31cpp:
(cd testsuite/openmodelica/cppruntime/libraries/msl31 && time $(MAKE) -f Makefile > testsuite-msl31-cpp-trace.txt 2>&1)
echo "log is in testsuite/openmodelica/cppruntime/libraries/msl31/testsuite-msl31-cpp-trace.txt"
testlibrariemsl32cpp:
(cd testsuite/openmodelica/cppruntime/libraries/msl32 && time $(MAKE) -f Makefile > testsuite-msl32-cpp-trace.txt 2>&1)
echo "log is in testsuite/openmodelica/cppruntime/libraries/msl32/testsuite-msl32-cpp-trace.txt"
runtimeCPPclean:
$(MAKE) -C SimulationRuntime/cpp/ -f $(defaultMakefileTarget) clean
fmil:
test -d 3rdParty/FMIL
mkdir -p 3rdParty/FMIL/build
(cd 3rdParty/FMIL/build && test -f Makefile || CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS) -g" CPPFLAGS="$(CPPFLAGS)" $(CMAKE) -D CMAKE_AR:String="$(AR)" -D FMILIB_BUILD_SHARED_LIB:Bool=$(FMILIB_SHARED) "-DFMILIB_FMI_PLATFORM:String=$(MODELICA_SPEC_PLATFORM)" -D FMILIB_BUILD_TESTS:Bool=OFF -D FMILIB_GENERATE_DOXYGEN_DOC:Bool=OFF -DCMAKE_COLOR_MAKEFILE:Bool=OFF -DFMILIB_INSTALL_PREFIX:String=../install .. -G $(CMAKE_TARGET))
test -f 3rdParty/FMIL/build/$(LIBFMILIB) || $(MAKE) -C 3rdParty/FMIL/build
test -d 3rdParty/FMIL/install || $(MAKE) -C 3rdParty/FMIL/build install
test "(" ! `uname` = Darwin ")" -o "(" ! -f 3rdParty/FMIL/build/libfmilib_shared$(SHREXT) ")" || install_name_tool -id @rpath/libfmilib_shared$(SHREXT) 3rdParty/FMIL/build/libfmilib_shared$(SHREXT)
cp -pPR 3rdParty/FMIL/build/$(LIBFMILIB) $(builddir_lib)/omc/
test ! -f build/lib/omc/libfmilib_shared$(SHREXT) || ln -sf libfmilib_shared$(SHREXT) build/lib/omc/libfmilib$(SHREXT)
#TODO: Only copy required headers, add them in omc/fmi subfolder, and do not copy c/txt-files
#cp -rp 3rdParty/FMIL/install/include/* $(builddir_inc)
qjson:
test -d 3rdParty/qjson-0.8.1
mkdir -p 3rdParty/qjson-0.8.1/build/include/qjson
(cd 3rdParty/qjson-0.8.1/build && test -f Makefile || CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" $(CMAKE) -D CMAKE_AR:String="$(AR)" .. -G $(CMAKE_TARGET))
test -f 3rdParty/qjson-0.8.1/build/lib/libqjson$(SHREXT) || $(MAKE) -C 3rdParty/qjson-0.8.1/build
test "(" ! `uname` = Darwin ")" -o "(" ! -f 3rdParty/qjson-0.8.1/build/lib/libqjson$(SHREXT) ")" || install_name_tool -id @rpath/libqjson$(SHREXT) 3rdParty/qjson-0.8.1/build/lib/libqjson$(SHREXT)
cp -a 3rdParty/qjson-0.8.1/build/lib/libqjson*$(SHREXT)* $(builddir_lib)/omc/
cp -a 3rdParty/qjson-0.8.1/src/*.h 3rdParty/qjson-0.8.1/build/include/qjson
CMinpack:
test -d 3rdParty/CMinpack
mkdir -p 3rdParty/CMinpack/build
(cd 3rdParty/CMinpack/build && test -f Makefile || CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" $(CMAKE) -D CMAKE_AR:String="$(AR)" -DCMAKE_COLOR_MAKEFILE:Bool=OFF -DSHARED_LIBS=$(CMINPACKLIB_SHARED) -DCMAKE_INSTALL_PREFIX:String=../install .. -G $(CMAKE_TARGET))
test -f 3rdParty/CMinpack/install/lib*/$(LIBCMINPACKLIB)* || $(MAKE) -C 3rdParty/CMinpack/build
test -d 3rdParty/CMinpack/install || $(MAKE) -C 3rdParty/CMinpack/build install
test ! `uname` = Darwin || install_name_tool -id @rpath/$(LIBCMINPACKLIB) 3rdParty/CMinpack/install/lib/$(LIBCMINPACKLIB)
# copy dll/so to lib/omc/ folders
(cp -af 3rdParty/CMinpack/install/lib*/$(LIBCMINPACKLIB)* $(builddir_lib)/omc)
# Darwin has to be special always
(test ! `uname` = Darwin || cp -af 3rdParty/CMinpack/install/lib*/*.dylib $(builddir_lib)/omc)
CMinpack-clean:
rm -rf 3rdParty/CMinpack/install
if test -f 3rdParty/CMinpack/build/Makefile; then make -C 3rdParty/CMinpack/build clean; fi
rm -f 3rdParty/CMinpack/build/Makefile
Cdaskr:
test -d 3rdParty/Cdaskr/solver
(cd 3rdParty/Cdaskr/solver && CC="$(CC)" CFLAGS="$(CFLAGS)" make -f Makefile)
Cdaskr-clean:
cd 3rdParty/Cdaskr/solver && make -f Makefile clean
testfast: test
test:
(time $(MAKE) -C testsuite -f Makefile)
testlog:
(time $(MAKE) -C testsuite -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!
testmos:
(time $(MAKE) -C testsuite -f Makefile omc-diff)
(time $(MAKE) -C testsuite/simulation/modelica/others -f Makefile)
testsimulation:
(time $(MAKE) -C testsuite -f Makefile simulation)
testmo:
(cd testsuite/flattening/modelica && time $(MAKE) -f Makefile test)
testmeta:
(cd testsuite/metamodelica/meta && time $(MAKE) -f Makefile)
(cd testsuite/flattening/modelica/records && time $(MAKE) -f Makefile)
testboot:
(cd testsuite/openmodelica/bootstrapping && time ../../../build/bin/omc MainTest.mos)
t:
(cd testsuite/metamodelica/meta && time ../../rtest -v SimplifyTest.mos)
testlibraries:
(cd testsuite/simulation/libraries && time $(MAKE) -f Makefile)
testlibrariemsl31:
(time $(MAKE) -C testsuite -f Makefile omc-diff)
(cd testsuite/simulation/libraries/msl31 && time $(MAKE) -f Makefile > testsuite-msl31-trace.txt 2>&1)
echo "log is in testsuite/simulation/libraries/msl31/testsuite-msl31-trace.txt"
testlibrariemsl32:
(time $(MAKE) -C testsuite -f Makefile omc-diff)
(cd testsuite/simulation/libraries/msl32 && time $(MAKE) -f Makefile > testsuite-msl32-trace.txt 2>&1)
echo "log is in testsuite/simulation/libraries/msl32/testsuite-msl31-trace.txt"
testcpp:
(cd testsuite/openmodelica/cppruntime/ && time $(MAKE) -f Makefile > testsuite-cpp-trace.txt 2>&1)
echo "log is in testsuite/openmodelica/cppruntime/testsuite-cpp-trace.txt"
testfmi:
(cd testsuite/openmodelica/fmi && time $(MAKE) -f Makefile)
testcmsvc:
(cd testsuite/openmodelica/cruntime/msvc/ && time $(MAKE) -f Makefile > testsuite-c_mcvc-trace.txt 2>&1)
echo "log is in testsuite/openmodelica/cruntime/msvc/testsuite-c_mcvc-trace.txt"
testSummary:
(cd testsuite && time $(MAKE) -f Makefile | grep "==")
testPar:
(cd testsuite/partest && time ./runtests.pl -j8)
mosh:
$(MAKE) -C mosh/src -f $(defaultMakefileTarget)
susan: all sustst
sustst:
(cd Compiler/susan_codegen && $(MAKE) -f Makefile test)
include Makefile.libraries
# a rule to check the .mo sources with the bootstrapped compiler!
checkcompiler:
$(MAKE) -C testsuite/openmodelica/bootstrapping -f $(MAKEFILE_BOOT) build
cleancompiler:
cd Compiler/omc_release && rm -f *.srz *.c *.h *.sig *.o omc *.exe
distclean: clean
(cd Compiler && $(MAKE) -f $(defaultMakefileTarget) reallyclean)
(cd Compiler/omc_release && $(MAKE) -f $(defaultMakefileTarget) reallyclean)
rm -f Compiler/.depend
rm -f OMShell/Makefile OMNotebook/ext/Makefile OMNotebook/OMNotebookQT4/Makefile
rm -f $(autoconfGeneratedFiles)
rm -f config.status config.log
rm -rf build/
fmil-clean:
rm -rf 3rdParty/FMIL/build 3rdParty/FMIL/install 3rdParty/FMIL/Makefile
gc-clean:
if test -f 3rdParty/gc-7.2/Makefile; then make -C 3rdParty/gc-7.2 clean; fi
rm -f 3rdParty/gc-7.2/Makefile
bootstrap-clean:
$(MAKE) -C Compiler/boot clean -f $(defaultMakefileTarget)
openblas-clean:
# OpenBLAS make clean actually gives error-messages. Let it do it, but silently
$(MAKE) -C 3rdParty/OpenBLAS-0.2.8 clean > /dev/null 2>&1
clean: qtclean fmil-clean opencl_rt_clean gc-clean lis-clean runtimeCPPclean CMinpack-clean Cdaskr-clean bootstrap-clean msgpack-clean graphstream-clean openblas-clean cjson-clean
(cd SimulationRuntime/c && $(MAKE) -f $(defaultMakefileTarget) clean)
(cd SimulationRuntime/interactive && $(MAKE) -f $(defaultMakefileTarget) clean)
(cd Compiler && $(MAKE) -f $(defaultMakefileTarget) clean)
(cd Compiler/omc_release && $(MAKE) -f $(defaultMakefileTarget) clean)
(cd mosh/src && $(MAKE) -f $(defaultMakefileTarget) clean)
(cd PythonInterface && $(MAKE) -f $(defaultMakefileTarget) clean)
if test -f 3rdParty/modelica3d/build/Makefile; then $(MAKE) -C 3rdParty/modelica3d/build clean; fi
if test -f 3rdParty/Ipopt-3.11.6/Makefile; then $(MAKE) -C 3rdParty/Ipopt-3.11.6 distclean || true; fi
(rm -rf 3rdParty/modelica3d/build)
(rm -rf SimulationRuntime/build_c)
rm -rf build/share build/lib build/include build/bin/OMShell* build/bin/OMNotebook* \
build/bin/omc build/bin/omc.exe build/bin/omc-diff build/bin/omc-diff.exe \
bom-error.log bom-error.sh tab-error.log
rm -rf libraries/Resources libraries/link-external-libs libraries/link-external-libs-emcc libraries/msl-external-libs
install-dirs:
@test ! "${DESTDIR}/${prefix}" -ef "${top_builddir}/build" || (echo Error: Install and build dirs are the same && false)
if [ "$(APP)" = ".app" ]; then mkdir -p ${INSTALL_APPDIR}; fi
mkdir -p ${INSTALL_BINDIR}
mkdir -p ${INSTALL_LIBDIR}
mkdir -p ${INSTALL_INCLUDEDIR}
mkdir -p ${INSTALL_DOCDIR}/omc/testmodels
mkdir -p ${INSTALL_MANDIR}/man1/
mkdir -p ${INSTALL_LOCALEDIR}
test ! -d ${builddir_doc}/omedit/ || mkdir -p ${INSTALL_DOCDIR}/omedit/
test ! -d ${builddir_share}/omnotebook/ || mkdir -p ${INSTALL_SHAREDIR}/omnotebook/
test ! -d ${builddir_share}/omshell/nls/ || mkdir -p ${INSTALL_SHAREDIR}/omshell/nls/
test ! -d ${builddir_share}/omedit/nls/ || mkdir -p ${INSTALL_SHAREDIR}/omedit/nls/
mkdir -p ${INSTALL_SHAREDIR}/omc/scripts ${INSTALL_JAVADIR}
install: install-dirs install-python
echo Installing OpenModelica...
# Application directory (OSX)
if [ "$(APP)" = ".app" ]; then cp -rp ${builddir_app} $(INSTALL_APPDIR); fi
# Binaries
cp -rp ${builddir_bin}/* ${INSTALL_BINDIR}
# Libraries
cp -rp ${builddir_lib}/* ${INSTALL_LIBDIR}
# Includes
cp -rp ${builddir_inc}/* ${INSTALL_INCLUDEDIR}
# License
cp -p COPYING ${INSTALL_DOCDIR}/omc/
# Documents
cp -p ${builddir_doc}/omc/*.pdf ${INSTALL_DOCDIR}/omc/
cp -p ${builddir_doc}/omc/*.txt ${INSTALL_DOCDIR}/omc/
cp -p ${builddir_doc}/omc/testmodels/* ${INSTALL_DOCDIR}/omc/testmodels/
test ! -d ${builddir_doc}/omedit/ || cp -p ${builddir_doc}/omedit/* ${INSTALL_DOCDIR}/omedit/
# man pages
cp -p ${builddir_man}/man1/*.gz ${INSTALL_MANDIR}/man1/
# Shared data
test ! -d ${builddir_share}/omnotebook/ || cp -rp ${builddir_share}/omnotebook/* ${INSTALL_SHAREDIR}/omnotebook/
test ! -d ${builddir_share}/omshell/ || cp -p ${builddir_share}/omshell/*.xml ${INSTALL_SHAREDIR}/omshell/
test ! -d ${builddir_share}/omshell/nls/ || cp -p ${builddir_share}/omshell/nls/*.qm ${INSTALL_SHAREDIR}/omshell/nls/
test ! -d ${builddir_share}/omedit/nls/ || cp -p ${builddir_share}/omedit/nls/*.qm ${INSTALL_SHAREDIR}/omedit/nls/
# Scripts
cp -rp ${builddir_share}/omc/scripts/*.* ${builddir_share}/omc/scripts/OpenTurns ${INSTALL_SHAREDIR}/omc/scripts
# Java
cp -p ${builddir_java}/* ${INSTALL_JAVADIR}
# Translations
cp -rp ${builddir_locale}/* ${INSTALL_LOCALEDIR}/
3rdParty/msgpack-0.5.8/Makefile:
cd 3rdParty/msgpack-0.5.8 && ./configure "--host=$(host)" CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS) $(MSGPACK_CFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS) "
build/lib/omc/libmsgpackc.so.2.0.0: 3rdParty/msgpack-0.5.8/Makefile
$(MAKE) -C 3rdParty/msgpack-0.5.8
cp -a 3rdParty/msgpack-0.5.8/src/.libs/libmsgpackc.so* build/lib/omc/
build/lib/omc/libmsgpackc.2.dylib: 3rdParty/msgpack-0.5.8/Makefile
$(MAKE) -C 3rdParty/msgpack-0.5.8
install_name_tool -id @rpath/libmsgpackc.2.dylib 3rdParty/msgpack-0.5.8/src/.libs/libmsgpackc.2.dylib
cp -a 3rdParty/msgpack-0.5.8/src/.libs/libmsgpackc*dylib build/lib/omc/
cp -a 3rdParty/msgpack-0.5.8/src/msgpack.h 3rdParty/msgpack-0.5.8/src/msgpack/ $(builddir_inc)/c
build/lib/omc/libmsgpackc.a: 3rdParty/msgpack-0.5.8/Makefile
$(MAKE) -C 3rdParty/msgpack-0.5.8
cp -a 3rdParty/msgpack-0.5.8/src/.libs/libmsgpackc.a build/lib/omc/
cp -a 3rdParty/msgpack-0.5.8/src/msgpack.h 3rdParty/msgpack-0.5.8/src/msgpack/ $(builddir_inc)/c
ifeq ($(SHREXT),.so)
msgpack: build/lib/omc/libmsgpackc.so.2.0.0
else
ifeq ($(SHREXT),.dylib)
msgpack: build/lib/omc/libmsgpackc.2.dylib
else
msgpack: build/lib/omc/libmsgpackc.a
endif
endif
msgpack-clean:
test ! -f 3rdParty/msgpack-0.5.8/Makefile || $(MAKE) -C 3rdParty/msgpack-0.5.8 distclean || true
rm -f 3rdParty/msgpack-0.5.8/Makefile
graphstream: mkbuilddirs build/share/omc/java/org.omc.graphstream.jar
if test -f 3rdParty/graphstream/Makefile; then $(MAKE) CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" -C 3rdParty/graphstream/; fi
build/share/omc/java/org.omc.graphstream.jar: mkbuilddirs
if test -f 3rdParty/graphstream/org.omc.graphstream.jar; then cp -p 3rdParty/graphstream/org.omc.graphstream.jar build/share/omc/java/.; fi
graphstream-clean:
if test -f 3rdParty/graphstream/Makefile; then $(MAKE) -C 3rdParty/graphstream/ clean; fi