forked from OpenModelica/OMCompiler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.common
420 lines (357 loc) · 22.9 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
418
419
420
inclu.PHONY : all omc release clean .testvariables mkbuilddirs
unexport PREFIX
top_builddir = $(OMBUILDDIR)
builddir_app=$(OMBUILDDIR)/Applications/
builddir_bin=$(OMBUILDDIR)/bin
builddir_lib=$(OMBUILDDIR)/lib
builddir_lib_omc=$(OMBUILDDIR)/$(LIB_OMC)
builddir_inc=$(OMBUILDDIR)/include/omc
builddir_doc=$(OMBUILDDIR)/share/doc
builddir_share=$(OMBUILDDIR)/share/
builddir_man=$(OMBUILDDIR)/share/man/
builddir_java=$(OMBUILDDIR)/share/omc/java/
builddir_locale=$(OMBUILDDIR)/share/locale/
INSTALL_APPDIR = ${DESTDIR}/Applications/MacPorts/
INSTALL_BINDIR = ${DESTDIR}${bindir}
INSTALL_LIBDIR = ${DESTDIR}${libdir}/
INSTALL_INCLUDEDIR = ${DESTDIR}${includedir}
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 all mkbuilddirs fmi test install-dirs susan susan_all susgen sustst install-openturns runtimeCPPinstall CMinpack metis Cdaskr boehm-gc
mkbuilddirs:
@echo Making build directories under $(OMBUILDDIR)
@if [ "$(APP)" = ".app" ]; then mkdir -p $(builddir_app); fi
@mkdir -p $(builddir_bin)
@mkdir -p $(OMBUILDDIR)/lib/omc/emcc
@mkdir -p $(builddir_lib_omc)
@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_inc)/scripting-API
@mkdir -p $(builddir_java)
@mkdir -p $(builddir_share)/omc/scripts/OpenTurns/
@mkdir -p $(builddir_doc)/omc/testmodels
@mkdir -p $(builddir_doc)/omc/SimulationRuntime/IntegrationAlgorithms
@mkdir -p $(builddir_man)/man1/
release: omc
bootstrap-dependencies: graphstream $(BOOTSTRAP_FMIL_DEP)
# NOTE: OpenModelicaBootstrappingHeader.h has to be regenerated without any other process writing to so/etc or you get bus errors
$(MAKE) -f $(defaultMakefileTarget) -C Compiler OpenModelicaBootstrappingHeader.h OMBUILDDIR=$(OMBUILDDIR)
$(MAKE) -f $(defaultMakefileTarget) -C Compiler/runtime install OMBUILDDIR=$(OMBUILDDIR)
$(MAKE) -f $(defaultMakefileTarget) -C Compiler builtin install_scripts OMBUILDDIR=$(OMBUILDDIR)
$(MAKE) -f $(defaultMakefileTarget) -C Parser install OMBUILDDIR=$(OMBUILDDIR)
sim-dependencies: fmi fmil opencl_rt lis metis fmi fmil
install-openturns: mkbuilddirs
(time cp SimulationRuntime/OpenTurns/* $(builddir_share)/omc/scripts/OpenTurns/)
$(builddir_share)/omc/omc_communication.idl: Compiler/runtime/omc_communication.idl
mkdir -p $(builddir_share)/omc
cp -a "$<" "$@"
idl: $(builddir_share)/omc/omc_communication.idl
interactive-common: .testvariables mkbuilddirs boehm-gc idl ModelicaExternalC
interactive-short: .testvariables interactive-common
$(MAKE) -C SimulationRuntime/c -f $(defaultMakefileTarget) bootstrap-dependencies OMBUILDDIR=$(OMBUILDDIR)
interactive: .testvariables interactive-common fmil lis Cdaskr CMinpack docs $(IPOPT_TARGET) $(UMFPACK_TARGET)
$(MAKE) -C SimulationRuntime/c -f $(defaultMakefileTarget) OMBUILDDIR=$(OMBUILDDIR)
docs:
$(MAKE) -C Compiler/Translation OMBUILDDIR=$(OMBUILDDIR) release
(cp -p Examples/*.* $(builddir_doc)/omc/testmodels/)
rm -f $(builddir_doc)/omc/testmodels/CMake*.txt
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 $(OMBUILDDIR)/include/omc/c/gc.h $(OMBUILDDIR)/include/omc/c/gc_config_macros.h $(OMBUILDDIR)/include/omc/c/gc_version.h $(OMBUILDDIR)/include/omc/c/gc_pthread_redirects.h
$(OMBUILDDIR)/$(LIB_OMC)/libomcgc.a: 3rdParty/gc/.libs/libomcgc.a mkbuilddirs
cp -p $< $@
3rdParty/gc/.libs/libomcgc.a: 3rdParty/gc/Makefile
$(MAKE) -C 3rdParty/gc/ libomcgc.la
$(OMBUILDDIR)/include/omc/c/gc.h: 3rdParty/gc/include/gc.h mkbuilddirs
cp -pPR $< $@
$(OMBUILDDIR)/include/omc/c/gc_config_macros.h: 3rdParty/gc/include/gc_config_macros.h mkbuilddirs
cp -pPR $< $@
$(OMBUILDDIR)/include/omc/c/gc_version.h: 3rdParty/gc/include/gc_version.h mkbuilddirs
cp -pPR $< $@
$(OMBUILDDIR)/include/omc/c/gc_pthread_redirects.h: 3rdParty/gc/include/gc_pthread_redirects.h mkbuilddirs
cp -pPR $< $@
3rdParty/gc/Makefile: 3rdParty/gc/configure.ac
(cd 3rdParty/gc && autoreconf -vif && automake --add-missing && ./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/Makefile: $(LAPACK_TARGET)
@# Note: CXX is passed LDFLAGS, which is wrong. However, Ipopt does not respect LDFLAGS and fails to link OSX C++ code if we do not do this.
(cd 3rdParty/Ipopt && ./configure --with-pic "CC=$(CC)" CFLAGS="$(CFLAGS)" CXX="$(CXX) $(LDFLAGS_LIBSTDCXX)" CXXFLAGS="$(CXXFLAGS)" F77="$(FC)" LDFLAGS="-L$(OMBUILDDIR)/$(LIB_OMC) $(LDFLAGS)" --with-lapack-lib="$(LD_LAPACK)" --with-blas-lib="$(LD_LAPACK)" "--host=$(host)" --without-metis --without-HSLold --without-HSL)
$(OMBUILDDIR)/$(LIB_OMC)/libipopt.la: 3rdParty/Ipopt/Makefile
$(MAKE) -C 3rdParty/Ipopt
$(MAKE) -C 3rdParty/Ipopt install
test ! `uname` = Darwin || install_name_tool -id @rpath/libipopt.0.0.0.dylib 3rdParty/Ipopt/lib/libipopt.0.0.0.dylib
test ! `uname` = Darwin || install_name_tool -id @rpath/libcoinmumps.1.5.2.dylib 3rdParty/Ipopt/lib/libcoinmumps.1.5.2.dylib
cp -a 3rdParty/Ipopt/lib*/*.* $(OMBUILDDIR)/$(LIB_OMC)
ipopt: $(OMBUILDDIR)/$(LIB_OMC)/libipopt.la
$(OMBUILDDIR)/$(LIB_OMC)/libumfpack$(SHREXT): 3rdParty/SuiteSparse/CMakeLists.txt
mkdir -p 3rdParty/SuiteSparse/build
cd 3rdParty/SuiteSparse/build && $(CMAKE) .. -G $(CMAKE_TARGET) -DCMAKE_VERBOSE_MAKEFILE:Bool=ON -DCMAKE_INSTALL_PREFIX:PATH="$(OMBUILDDIR)" -DLIB_OMC="$(LIB_OMC)" -DBUILD_SHARED_LIBS:Bool=$(UMFPACK_SHARED)
$(MAKE) -C 3rdParty/SuiteSparse/build install
test ! `uname` = Darwin || install_name_tool -id @rpath/libumfpack.dylib "$@"
test ! `uname` = Darwin || install_name_tool -id @rpath/libamd.dylib "$(OMBUILDDIR)/$(LIB_OMC)/libamd$(SHREXT)"
#cp -au 3rdParty/SuiteSparse/build/*.$(STATIC_EXT) build/$(LIB_OMC)
#mkdir --parent build/include/omc/c/suitesparse
#cp -a 3rdParty/SuiteSparse/UMFPACK/Include/*.h build/include/omc/c/suitesparse
#cp -a 3rdParty/SuiteSparse/AMD/Include/*.h build/include/omc/c/suitesparse
#cp -a 3rdParty/SuiteSparse/UFconfig/*.h build/include/omc/c/suitesparse
umfpack: $(OMBUILDDIR)/$(LIB_OMC)/libumfpack$(SHREXT)
umfpack-clean:
if test -d 3rdParty/SuiteSparse/build ; then cd 3rdParty/SuiteSparse/build && make clean ; fi
rm -rf $(OMBUILDDIR)/include/omc/c/suitesparse
rm -f $(OMBUILDDIR)/$(LIB_OMC)/libumfpack.a
rm -f $(OMBUILDDIR)/$(LIB_OMC)/libamd.a
$(OMBUILDDIR)/$(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=$(OMBUILDDIR) OPENBLAS_LIBRARY_DIR="$(OMBUILDDIR)/$(LIB_OMC) OPENBLAS_INCLUDE_DIR="$(OMBUILDDIR)/3rdParty/build/install-includes/ NO_LAPACKE=1 LIBNAMESUFFIX=openmodelica install
openblas: $(OMBUILDDIR)/$(LIB_OMC)/libopenblas_openmodelica.a
opencl_rt:
ifeq ("$(OPENCL)","Yes")
$(MAKE) -C SimulationRuntime/ParModelica/explicit/openclrt -f $(defaultMakefileTarget) OMBUILDDIR=$(OMBUILDDIR)
endif
opencl_rt_clean:
$(MAKE) -C SimulationRuntime/ParModelica/explicit/openclrt -f $(defaultMakefileTarget) clean OMBUILDDIR=$(OMBUILDDIR)
breakprocess:
(cd tools/debugging/ && time g++ BreakProcess.cpp -o BreakProcess -static-libgcc)
(cd tools/debugging/ && cp BreakProcess.exe $(builddir_bin))
all-runtimeCPPinstall:
$(MAKE) mkbuilddirs
$(MAKE) CMinpack
$(MAKE) all runtimeCPPinstall OMBUILDDIR=$(OMBUILDDIR)
omc-and-runtimeCPPinstall: mkbuilddirs
$(MAKE) CMinpack
$(MAKE) omc runtimeCPPinstall OMBUILDDIR=$(OMBUILDDIR)
runtimeCPP: CMinpack
$(MAKE) -C SimulationRuntime/cpp/ -f $(defaultMakefileTarget) OMBUILDDIR=$(OMBUILDDIR)
CMAKE_ARGS=$(filter CMAKE_%, $(MAKEFLAGS))
runtimeCPPinstall: CMinpack copycppheader
$(MAKE) -C SimulationRuntime/cpp/ -f $(defaultMakefileTarget) CC="$(CC)" CXX="$(CXX)" install ANALYZATION_MODE="$(ANALYZATION_MODE)" $(CMAKE_ARGS) OMBUILDDIR=$(OMBUILDDIR)
test ! `uname` = Darwin || install_name_tool -id @rpath/cpp/libOMCppCVode.dylib $(OMBUILDDIR)/$(LIB_OMC)/cpp/libOMCppCVode.dylib
test ! `uname` = Darwin || install_name_tool -id @rpath/cpp/libOMCppDataExchange.dylib $(OMBUILDDIR)/$(LIB_OMC)/cpp/libOMCppDataExchange.dylib
test ! `uname` = Darwin || install_name_tool -id @rpath/cpp/libOMCppEuler.dylib $(OMBUILDDIR)/$(LIB_OMC)/cpp/libOMCppEuler.dylib
test ! `uname` = Darwin || install_name_tool -id @rpath/cpp/libOMCppNewton.dylib $(OMBUILDDIR)/$(LIB_OMC)/cpp/libOMCppNewton.dylib
test ! `uname` = Darwin || install_name_tool -id @rpath/cpp/libOMCppSimulationSettings.dylib $(OMBUILDDIR)/$(LIB_OMC)/cpp/libOMCppSimulationSettings.dylib
test ! `uname` = Darwin || install_name_tool -id @rpath/cpp/libOMCppSolver.dylib $(OMBUILDDIR)/$(LIB_OMC)/cpp/libOMCppSolver.dylib
test ! `uname` = Darwin || install_name_tool -id @rpath/cpp/libOMCppSystem.dylib $(OMBUILDDIR)/$(LIB_OMC)/cpp/libOMCppSystem.dylib
test ! `uname` = Darwin || install_name_tool -change libOMCppSolver.dylib @rpath/cpp/libOMCppSolver.dylib $(OMBUILDDIR)/$(LIB_OMC)/cpp/libOMCppCVode.dylib
test ! `uname` = Darwin || install_name_tool -change libOMCppSolver.dylib @rpath/cpp/libOMCppSolver.dylib $(OMBUILDDIR)/$(LIB_OMC)/cpp/libOMCppEuler.dylib
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 OMBUILDDIR=$(OMBUILDDIR)
fmil:
test -d 3rdParty/FMIL
mkdir -p 3rdParty/FMIL/build
(cd 3rdParty/FMIL/build && test -f Makefile || CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" $(CMAKE) -D CMAKE_AR:String="$(AR)" -D FMILIB_BUILD_SHARED_LIB:Bool=$(FMILIB_SHARED) -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))
@# Pass CC/CFLAGS/CPPFLAGS because FMIL does not configure subprojects with the selected CC. Shocking; a cmake project not working the way it should.
test -f 3rdParty/FMIL/build/$(LIBFMILIB) || CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" $(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 $(OMBUILDDIR)/$(LIB_OMC)/libfmilib_shared$(SHREXT) || ln -sf libfmilib_shared$(SHREXT) $(OMBUILDDIR)/$(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) -DCMAKE_VERBOSE_MAKEFILE:Bool=ON -D CMAKE_AR:String="$(AR)" -DCMAKE_COLOR_MAKEFILE:Bool=OFF -DBUILD_SHARED_LIBS:Bool=$(CMINPACKLIB_SHARED) -DCMAKE_INSTALL_PREFIX:String=../install -DCMINPACK_LIB_INSTALL_DIR:String=../install .. -G $(CMAKE_TARGET))
test -f 3rdParty/CMinpack/build/$(LIBCMINPACKLIB) || $(MAKE) -C 3rdParty/CMinpack/build
test ! `uname` = Darwin || install_name_tool -id @rpath/$(LIBCMINPACKLIB) 3rdParty/CMinpack/build/$(LIBCMINPACKLIB)
# copy dll/so to $(LIB_OMC)/ folders
(rm -f $(builddir_lib_omc)/$(LIBCMINPACKLIB)*)
(cp -af 3rdParty/CMinpack/build/$(LIBCMINPACKLIB)* $(builddir_lib_omc))
# Darwin has to be special always
(test ! `uname` = Darwin || cp -af 3rdParty/CMinpack/build/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
test ! -d 3rdParty/CMinpack/build || rm -r 3rdParty/CMinpack/build
metis:
(cd 3rdParty/metis-5.1.0 && $(CMAKE) -DCMAKE_VERBOSE_MAKEFILE:Bool=ON -G $(CMAKE_TARGET) && CC="$(CC)" CFLAGS="$(CFLAGS)" make)
cp 3rdParty/metis-5.1.0/libmetis/libmetis.a $(builddir_lib_omc)
metis-clean:
test ! -f 3rdParty/metis-5.1.0/Makefile || make -C 3rdParty/metis-5.1.0 clean
rm -rf 3rdParty/metis-5.1.0/CMakeCache.txt 3rdParty/metis-5.1.0/libmetis/libmetis.a 3rdParty/metis-5.1.0/CMakeFiles 3rdParty/metis-5.1.0/Makefile 3rdParty/metis-5.1.0/cmake_install.cmake 3rdParty/metis-5.1.0/include/CMakeFiles 3rdParty/metis-5.1.0/include/Makefile 3rdParty/metis-5.1.0/include/cmake_install.cmake 3rdParty/metis-5.1.0/libmetis/CMakeFiles 3rdParty/metis-5.1.0/libmetis/Makefile 3rdParty/metis-5.1.0/libmetis/cmake_install.cmake 3rdParty/metis-5.1.0/programs/CMakeFiles 3rdParty/metis-5.1.0/programs/Makefile 3rdParty/metis-5.1.0/programs/cmake_install.cmake
Cdaskr:
test -d 3rdParty/Cdaskr/solver
(cd 3rdParty/Cdaskr/solver && make -f Makefile CC="$(CC)" CFLAGS="$(CFLAGS)")
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!
susan: all sustst
sustst:
(cd Compiler/susan_codegen && $(MAKE) -f Makefile test)
cleancompiler:
cd Compiler/boot && rm -rf "$(OMBUILDDIR)"
$(MAKE) -f $(defaultMakefileTarget) -C Compiler/Script clean OMBUILDDIR=$(OMBUILDDIR)
distclean: clean
(cd Compiler && $(MAKE) -f $(defaultMakefileTarget) reallyclean OMBUILDDIR=$(OMBUILDDIR))
rm -f Compiler/.depend
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/Makefile; then make -C 3rdParty/gc distclean; fi
rm -f 3rdParty/gc/Makefile
bootstrap-clean:
$(MAKE) -C Compiler/boot clean -f $(defaultMakefileTarget) OMBUILDDIR=$(OMBUILDDIR)
openblas-clean:
# OpenBLAS make clean actually gives error-messages. Let it do it, but silently
test ! -d 3rdParty/OpenBLAS-0.2.8 || $(MAKE) -C 3rdParty/OpenBLAS-0.2.8 clean > /dev/null 2>&1
clean: fmil-clean opencl_rt_clean gc-clean lis-clean runtimeCPPclean CMinpack-clean metis-clean Cdaskr-clean bootstrap-clean msgpack-clean graphstream-clean openblas-clean umfpack-clean
(cd SimulationRuntime/c && $(MAKE) -f $(defaultMakefileTarget) clean OMBUILDDIR=$(OMBUILDDIR))
(cd Compiler && $(MAKE) -f $(defaultMakefileTarget) clean OMBUILDDIR=$(OMBUILDDIR))
(cd Parser && $(MAKE) -f $(defaultMakefileTarget) clean OMBUILDDIR=$(OMBUILDDIR))
$(MAKE) -C Compiler/Template -f $(defaultMakefileTarget) clean OMBUILDDIR=$(OMBUILDDIR)
# remove ModelicaExternalC stuff
if test -f 3rdParty/ModelicaExternalC/BuildProjects/autotools/Makefile; then $(MAKE) -C 3rdParty/ModelicaExternalC/BuildProjects/autotools/ distclean OMBUILDDIR=$(OMBUILDDIR); fi
# remove Ipopt/Makefile if there is no Ipopt/Ipopt/Makefile to run configure again!
if test -f 3rdParty/Ipopt/Ipopt/Makefile; then true; else rm -f 3rdParty/Ipopt/Makefile || true; fi
if test -f 3rdParty/Ipopt/Makefile; then $(MAKE) -C 3rdParty/Ipopt distclean || true; fi
(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
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}/omc
mkdir -p ${INSTALL_INCLUDEDIR}/$(host_short)/omc/antlr3
mkdir -p ${INSTALL_DOCDIR}/omc/testmodels
mkdir -p ${INSTALL_MANDIR}/man1/
mkdir -p ${INSTALL_LOCALEDIR}
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
echo Installing OpenModelica...
# Application directory (OSX)
if [ "$(APP)" = ".app" ]; then cp -rp ${builddir_app} $(INSTALL_APPDIR); fi
# Binaries
cp -a ${builddir_bin}/* ${INSTALL_BINDIR}
# Libraries
cp -a ${builddir_lib}/* ${INSTALL_LIBDIR}
# Includes
cp -a ${builddir_inc}/* ${INSTALL_INCLUDEDIR}/omc
cp -a $(OMBUILDDIR)/include/$(host_short)/omc/antlr3 ${INSTALL_INCLUDEDIR}/$(host_short)/omc/antlr3
# License
cp -p COPYING ${INSTALL_DOCDIR}/omc/
# Documents
test -z "$(HAVE_DOCDIR)" || cp -p ${builddir_doc}/omc/*.pdf ${INSTALL_DOCDIR}/omc/
cp -p ${builddir_doc}/omc/testmodels/* ${INSTALL_DOCDIR}/omc/testmodels/
# man pages
# cp -p ${builddir_man}/man1/*.gz ${INSTALL_MANDIR}/man1/
# Shared data
cp -p ${builddir_share}/omc/*.* ${INSTALL_SHAREDIR}/omc/
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 $(OMBUILDDIR)/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
$(OMBUILDDIR)/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 $(OMBUILDDIR)/share/omc/java/.; fi
graphstream-clean:
if test -f 3rdParty/graphstream/Makefile; then $(MAKE) -C 3rdParty/graphstream/ clean; fi
sanity-check: omc
$(OMBUILDDIR)/bin/omc Examples/SanityCheck.mos
MODELICAEXTERNALC=3rdParty/ModelicaExternalC
ModelicaExternalC: $(LIBMODELICAEXTERNALC) $(LIBMODELICASTANDARDTABLES)
$(LIBMODELICAEXTERNALC):
(cd "$(MODELICAEXTERNALC)/BuildProjects/autotools" && (test -f Makefile || ./autogen.sh))
(cd "$(MODELICAEXTERNALC)/BuildProjects/autotools" && (test -f Makefile || (./configure ${MSL321_CONFIG_EXTRA_FLAGS} "--host=$(host)" --libdir="$(OMBUILDDIR)/$(LIB_OMC)/" CC="$(CC)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" $(MSL_EXTRA_ARGS) && $(MAKE) clean)))
$(MAKE) -C "$(MODELICAEXTERNALC)/BuildProjects/autotools"
$(MAKE) -C "$(MODELICAEXTERNALC)/BuildProjects/autotools" install
@test -f $@
$(LIBMODELICASTANDARDTABLES): $(LIBMODELICAEXTERNALC)
@test -f $@
git-clean:
test -e .git
git clean -fdx
git-sanity-check: git-clean
test "./Compiler/boot/bootstrap-sources.tar.xz" = "`find . -type f -size +684k | grep -v 3rdParty`"
for commit in `git rev-list origin/master..HEAD`; do \
(! git ls-tree --name-only -r $$commit | egrep "(.*[.](html|png|svg|o|so|la|stamp|a|dll|exe|cab|lnk|msi|log|class|jar|pyc|db|zip|DS_Store|pdf|tex|md5|dep)$$)|SimulationRuntime/cpp/Doc") || exit 1; \
done
! (git rev-list origin/master..HEAD | xargs git grep "Generated by Susan" -- Compiler/Template)