/
Makefile.in
191 lines (164 loc) · 8.13 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
all : release qtclients @OMSHELL_TERMINAL@
autoconfGeneratedFiles = @GENERATED_AUTOCONF_FILES@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
libdir = @libdir@
includedir = @includedir@
datadir = @datadir@
docdir = @docdir@
CMAKE = CC=$(CC) CXX=$(CXX) cmake
CMAKE_TARGET = "Unix Makefiles"
OPENCL = @OPENCL@
defaultMakefileTarget = Makefile
QMAKE=@QMAKE@
EXE=@EXE@
CC=@CC@
CXX=@CXX@
CFLAGS=@CFLAGS@
CPPFLAGS=@CPPFLAGS@
CXXFLAGS=@CXXFLAGS@
LINK=@LINK@
MSL_EXTRA_ARGS=@MSL_EXTRA_ARGS@
GC_THREADS=--enable-threads=posix
include Makefile.common
# We don't need OMDEV hacks, but using the same Makefile sure is nice!
.testvariables:
settings:
omc: omc-diff interactive docs fmi fmil opencl_rt lis
(cd Compiler && $(MAKE) -f Makefile release)
$(MAKE) omlibrary
omcd: omc-diff interactive docs fmi fmil opencl_rt lis
(cd Compiler && $(MAKE) -f Makefile debug)
boehm-gc-lib: @LIBGC@
build/lib/omc/libgc.so: 3rdParty/gc-7.2/.libs/libgc.so mkbuilddirs
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.*
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
$(MAKE) -C OMPlot/OMPlotGUI -f Makefile.unix
omedit: mkbuilddirs omplot
$(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
# configure --without-rml works using this target
bootstrap-from-tarball:
$(MAKE) bootstrap-dependencies
time $(MAKE) -C testsuite/openmodelica/bootstrapping -f LinkMain.makefile bootstrap-from-tarball
OPENMODELICAHOME=`pwd`/build time $(MAKE) bootstrap-from-compiled
$(MAKE) omlibrary
# configure --without-rml works using this target, but requires a compiled omc (either from bootstrap or regular one)
bootstrap-from-compiled:
test -f build/bin/omc
$(MAKE) bootstrap-dependencies
$(MAKE) -C testsuite/openmodelica/bootstrapping -f LinkMain.makefile bootstrap-from-compiled
$(MAKE) omlibrary
bootstrap-dependencies: omc-diff interactive docs fmi fmil opencl_rt lis
$(MAKE) -C Compiler/runtime install
$(MAKE) -C Compiler builtin install_scripts
$(MAKE) -C Parser install
$(MAKE) -C Compiler/modpar install
modelica3d:
ifeq (@MODELICA3D@,)
@echo Skipping Modelica3D
else
cd 3rdParty/modelica3d && mkdir -p build
cd 3rdParty/modelica3d/build && $(CMAKE) -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/lib/modcount/src/c/modcount.h 3rdParty/modelica3d/lib/modbus/src/c/modbus.h build/include/omc/
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/
lis-configure:
# Configure and build lis
if ! test -f 3rdParty/lis-1.4.12/Makefile; then cd 3rdParty/lis-1.4.12 && ./configure --enable-shared --disable-static 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/*' -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/*' -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'
fix-tab:
find . -type f \( ! -path '*/.svn/*' -prune \) -regextype posix-egrep -regex '.*\.(cpp|c|h|mo|tpl)$$' -exec sh -c 'sed -i "s/ / /g" "{}"' ";"
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