/
Makefile.in
219 lines (193 loc) · 9.09 KB
/
Makefile.in
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
all :
$(MAKE) boehm-gc-lib
$(MAKE) release qtclients @OMSHELL_TERMINAL@
autoconfGeneratedFiles = @GENERATED_AUTOCONF_FILES@
abs_top_builddir=@abs_top_builddir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
libdir = @libdir@
includedir = @includedir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
CMAKE = CC=$(CC) CXX=$(CXX) cmake
CMAKE_GCC = GCC_CC=$(CC) GCC_CXX=$(CXX) cmake
CMAKE_TARGET = "Unix Makefiles"
OPENCL = @OPENCL@
AR = @AR@
host = @host@
FC = @FC@
defaultMakefileTarget = Makefile
MAKEFILE_BOOT = LinkMain.makefile
QMAKE=@QMAKE@
APP=@APP@
CC=@CC@
CXX=@CXX@
GCC_CC=@CC@
GCC_CXX=@CXX@
CFLAGS=@CFLAGS@
MSGPACK_CFLAGS =
CPPFLAGS=@CPPFLAGS@
CXXFLAGS=@CXXFLAGS@
LDFLAGS=@LDFLAGS@
LINK=@LINK@
MSL_EXTRA_ARGS=@MSL_EXTRA_ARGS@
# LIBGC configuration is different for Linux (this file) and Windows (Makefile.omdev.mingw)
LIBGC_EXTRA_CONFIGURATION=--enable-threads=posix --enable-parallel-mark --enable-munmap=5
LIBFMILIB=@LIBFMILIB@
LIBCMINPACKLIB=@LIBCMINPACKLIB@
LD_LAPACK=@LD_LAPACK@
LAPACK_TARGET=@LAPACK_TARGET@
OPENBLAS_EXTRA_ARGS=@OPENBLAS_EXTRA_ARGS@
IPOPT_TARGET=ipopt
# We don't want the shared version, but symbols are not exported if we use the static version
# This compiles the shared and static versions, but we only copy the static version...
FMILIB_SHARED = @FMILIB_SHARED@
CMINPACKLIB_SHARED = @CMINPACKLIB_SHARED@
MODELICA_SPEC_PLATFORM=@MODELICA_SPEC_PLATFORM@
SHREXT = @SHREXT@
include Makefile.common
# We don't need OMDEV hacks, but using the same Makefile sure is nice!
.testvariables:
settings:
omc: @OMCTARGET@
omc-rml: omc-diff interactive docs fmil opencl_rt lis omc-rml-nolink graphstream
$(MAKE) -C Compiler -f Makefile release
$(MAKE) omlibrary
omc-rml-nolink:
$(MAKE) -C Compiler/omc_release nolink
boehm-gc-lib: @LIBGC@
build/lib/omc/libgc.so: 3rdParty/gc-7.2/.libs/libgc.so
mkdir -p build/lib/omc/
cp -pPR $< $<.* build/lib/omc/
3rdParty/gc-7.2/.libs/libgc.so: 3rdParty/gc-7.2/Makefile
$(MAKE) -C 3rdParty/gc-7.2/
qtclean-common:
rm -rf OMShell/bin/OMShell$(EXE) OMShell/OMShellGUI/omc_communication.*
rm -rf OMNotebook/bin/OMNotebook$(EXE) OMNotebook/OMNotebookGUI/omc_communication.*
rm -rf OMOptim/build/OMOptim$(EXE) OMOptim/build/omc_communication.*
for f in OMEdit/OMEditGUI \
OMNotebook/OMNotebookGUI \
OMOptim/build \
OMOptimBasis/build \
OMShell/OMShellGUI \
OMPlot/OMPlotGUI \
; do test ! -f $$f/Makefile || (make -C $$f clean && rm -f $$f/Makefile); done
ifeq ($(QMAKE),)
qtclients:
@echo "*** OpenModelica configured without support for Qt"
qtclean: qtclean-common
else ifeq (@IDLCMD@,)
qtclients:
@echo "*** OpenModelica configured without support for CORBA"
qtclean: qtclean-common
else
omnotebook: mkbuilddirs omplot
mkdir -p $(builddir_share)/omnotebook
$(MAKE) -C OMNotebook/OMNotebookGUI -f Makefile.unix
omshell: mkbuilddirs
$(MAKE) -C OMShell/OMShellGUI -f Makefile.unix
omplot: mkbuilddirs boehm-gc-lib
$(MAKE) -C OMPlot/OMPlotGUI -f Makefile.unix
omedit: mkbuilddirs omplot boehm-gc-lib qjson
$(MAKE) -C OMEdit/OMEditGUI -f Makefile.unix
ifeq (@with_paradiseo@,)
omoptim:
@echo "*** OpenModelica configured without support for OMOptim (--without-paradisEO)"
omoptimbasis:
@echo "*** OpenModelica configured without support for OMOptim (--without-paradisEO)"
else
omoptim: mkbuilddirs omoptimbasis
$(MAKE) -C OMOptim/build -f Makefile.unix
omoptimbasis: mkbuilddirs
$(MAKE) -C OMOptimBasis/build -f Makefile.unix
endif
qtclients: @OMNOTEBOOK@ omshell omedit omplot omoptim omoptimbasis
qtclean: qtclean-common
$(MAKE) -C OMShell/OMShellGUI -f Makefile.unix clean
$(MAKE) -C OMNotebook/OMNotebookGUI -f Makefile.unix clean
$(MAKE) -C OMEdit/OMEditGUI -f Makefile.unix clean
$(MAKE) -C OMPlot/OMPlotGUI -f Makefile.unix clean
$(MAKE) -C OMOptim/build -f Makefile.unix clean
$(MAKE) -C OMOptimBasis/build -f Makefile.unix clean
endif
omc-bootstrapped:
$(MAKE) bootstrap-dependencies
$(MAKE) -C Compiler/boot
$(MAKE) omlibrary
modelica3d:
ifeq (@MODELICA3D@,)
@echo Skipping Modelica3D
else
cd 3rdParty/modelica3d && mkdir -p build
cd 3rdParty/modelica3d/build && $(CMAKE_GCC) -DCMAKE_COLOR_MAKEFILE:Bool=OFF -DOSG_BACKEND=1 -DUSE_OMC=0 ..
$(MAKE) -C 3rdParty/modelica3d/build
cp -p 3rdParty/modelica3d/build/backends/osg-gtk/libm3d-osg-gtk.so 3rdParty/modelica3d/build/lib/proc3d/libproc3d.so build/lib/
cp -p 3rdParty/modelica3d/build/lib/modcount/libmodcount.a 3rdParty/modelica3d/build/lib/modbus/libmodbus.a build/lib/omc/
mkdir -p build/lib/omlibrary-modelica3d/blender2.59 build/lib/omlibrary-modelica3d/osg-gtk/
cp -p 3rdParty/modelica3d/examples/multibody/src/modelica/*.mo build/lib/omlibrary-modelica3d/
cp -p 3rdParty/modelica3d/backends/blender2.59/dbus-server.py build/lib/omlibrary-modelica3d/blender2.59/
cp -p 3rdParty/modelica3d/backends/osg-gtk/python/dbus-server.py build/lib/omlibrary-modelica3d/osg-gtk/
endif
lis: lis-configure mkbuilddirs
@echo Building Lis from sources
$(MAKE) -C 3rdParty/lis-1.4.12
# Copy the library; not headers (as they are not used by the runtime system)
cp -Pp 3rdParty/lis-1.4.12/src/.libs/liblis@SHREXT@* build/lib/omc/
@# FreeBSD lis does not create the symlinks...
! test -f build/lib/omc/liblis.so.0.0 -a ! -f build/lib/omc/liblis.so.0 || ln -s liblis.so.0.0 build/lib/omc/liblis.so.0
! test -f build/lib/omc/liblis.so.0.0 -a ! -f build/lib/omc/liblis.so || ln -s liblis.so.0.0 build/lib/omc/liblis.so
lis-configure:
# Configure and build lis
if ! test -f 3rdParty/lis-1.4.12/Makefile; then cd 3rdParty/lis-1.4.12 && ./configure "--host=$(host)" --enable-shared --disable-static MPICC="false" CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS) @LIS_LDFLAGS@" && $(MAKE) clean; fi
lis-clean:
if test -f 3rdParty/lis-1.4.12/Makefile; then $(MAKE) -C 3rdParty/lis-1.4.12 clean; fi
rm -f 3rdParty/lis-1.4.12/Makefile
fix-svn-props:
tools/apply_autoprops.py --config .svnprops .
fix-bom:
find . -type f \( ! -path '*/.svn/*' -or -path '*/.git/*' -prune \) | while read file;do sed -i '1 s/^\xef\xbb\xbf//' "$$file";done
SOURCE_DIRS=$(SOURCE_DIRS_UTF8) "libraries/Modelica 2.2.2" testsuite/flattening/libraries/3rdParty/HumMod
SOURCE_DIRS_UTF8=OM*/ Compiler/ SimulationRuntime/ mosh/ `bash -c echo libraries/{BioChem 1.0,ModelicaAdditions,Modelica_LinearSystems2 2.3,Modelica 1.6,ModelicaServices 1.0,ModelicaServices 1.0 modelica3d,Modelica 3.1,SimpleFluid,Modelica 3.2.1,SimpleVisual.mo}` `bash -c echo testsuite/flattening/libraries/3rdParty/{PlanarMechanics,siemens,SiemensPower,ThermoSysPro}` testsuite/openmodelica/modelicaML testsuite/AVM testsuite/simulation
bom-error:
rm -f bom-error.log bom-error.sh
echo "#!/bin/sh\ntest \"\`head -c3 \\\"\$$1\\\"\`\" = \"\`/bin/echo -ne \"\\xef\\xbb\\xbf\"\`\" && (echo \$$1 contains BOM >> bom-error.log)" > bom-error.sh
find $(SOURCE_DIRS) -type f \( ! -path '*/.svn/*' -or -path '*/.git/*' -prune \) \( ! -path 'libraries/Modelica 3.2.1/*' -prune \) -exec sh bom-error.sh "{}" ';'
@if test -e bom-error.log; then cat bom-error.log; fi
@test ! -e bom-error.log
rm -f bom-error.log bom-error.sh
tab-error:
! find $(SOURCE_DIRS) -regextype posix-egrep -regex '.*\.(cpp|c|h|mo|tpl)$$' -exec echo -n "{} " ';' -exec grep -c " " '{}' ';' | \
grep -v " 0\$$" | egrep -v '/omc_release/|/omc_debug/|/omc_profiling/|/GenTest/|/antlr-3.2/|Parser/MetaModelica_|Parser/ParModelica_|Parser/Modelica_3_|Parser/ModelicaParser'
# Trims trailing whitespace and replaces tabs with spaces
fix-whitespace:
find . -type f \( ! -path '*/.svn/*' -or -path '*/.git/*' -prune \) -regextype posix-egrep -regex '.*\.(cpp|c|h|mo|tpl)$$' -exec sh -c 'sed -i -e "s/ / /g" -e "s/ *\$$//" "{}"' ";"
spellcheck:
grep -oE 'gettext[(]["]([^"]|([\\]["]))*["]' `ls Compiler/*/*.mo | grep -v Flags.mo` | sed "s/[\\%]./ /g" | aspell -p ./.openmodelica.aspell --mode=ccpp --lang=en_US list | sort -u | sed 's/^/aspell: /' | tee aspell.log
@test ! -s aspell.log
thumbsdb-error:
! find . -name "Thumbs.db" | grep Thumbs.db
utf8-error:
rm -f utf8-error.log*
find $(SOURCE_DIRS_UTF8) -regextype posix-egrep -regex '.*\.(cpp|c|h|mo|tpl)$$' -exec bash -c "iconv -f UTF-8 -t UTF-8 '{}' -o /dev/null 2>utf8-error.log2 || (echo -n '{}: ' && head -n1 utf8-error.log2)" ';' 2>&1 > utf8-error.log
# Also detect some valid UTF-8 that were obviously fracked up by Eclipse on Windows.
find $(SOURCE_DIRS_UTF8) -regextype posix-egrep -regex '.*\.(cpp|c|h|mo|tpl)$$' -exec bash -c "grep 'Link[^A-Za-z0-9_,.;&-]*ping' '{}' | grep -v Linköping && (echo '{}: Failed Linköping test')" ';' 2>&1 >> utf8-error.log
@cat utf8-error.log
@test ! -s utf8-error.log
rm -f utf8-error.log*
utf8-iconv:
rm -f tmp
find $(SOURCE_DIRS) -regextype posix-egrep -regex '.*\.(cpp|c|h|mo|tpl)$$' -exec bash -c "iconv -f UTF-8 -t UTF-8 '{}' -o /dev/null 2>tmp || (rm -f tmp && cp '{}' tmp && iconv -f ISO-8859-1 -t UTF-8 tmp -o '{}' && echo Converted {} to UTF-8)" ';'
rm -f tmp
.PRECIOUS: Makefile
Makefile: Makefile.in config.status
$(top_builddir)/config.status
config.status: configure
./config.status -recheck
configure: configure.in
autoconf
emcc: msl-external-libs-emcc emcc-simulationruntime
emcc-simulationruntime:
mkdir -p build/lib/omc/emcc/
$(MAKE) -C SimulationRuntime/c emcc