-
Notifications
You must be signed in to change notification settings - Fork 298
/
Makefile.in
189 lines (164 loc) · 8.5 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
all: omc
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)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS)" cmake
CMAKE_RPATH = CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="@RPATH_QMAKE@" cmake
CMAKE_TARGET = "Unix Makefiles"
OPENCL = @OPENCL@
AR = @AR@
host = @host@
host_short = @host_short@
FC = @FC@
defaultMakefileTarget = Makefile
MAKEFILE_BOOT = LinkMain.makefile
QMAKE=@QMAKE@
APP=@APP@
CC=@CC@
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)
# Do not use munmap; it crashes processes...
LIBGC_EXTRA_CONFIGURATION=--enable-threads=posix --enable-parallel-mark
LIBFMILIB=@LIBFMILIB@
LIBCMINPACKLIB=@LIBCMINPACKLIB@
LD_LAPACK=@LD_LAPACK@
LAPACK_TARGET=@LAPACK_TARGET@
OPENBLAS_EXTRA_ARGS=@OPENBLAS_EXTRA_ARGS@
IPOPT_TARGET=ipopt
UMFPACK_TARGET=@UMFPACK_TARGET@
UMFPACK_SHARED=ON
# 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@
BOOST_INCLUDE = @BOOST_INCLUDE@
WITH_FMIL=@WITH_FMIL@
ifeq ($(WITH_FMIL),yes)
BOOTSTRAP_FMIL_DEP=fmil
endif
LIB_OMC=lib/@host_short@/omc
LIBMODELICAEXTERNALC=build/lib/@host_short@/omc/libModelicaExternalC@SHREXT@
LIBMODELICASTANDARDTABLES=build/lib/@host_short@/omc/libModelicaStandardTables@SHREXT@
include Makefile.common
# We don't need OMDEV hacks, but using the same Makefile sure is nice!
.testvariables:
settings:
omc: omc-bootstrapped
boehm-gc-lib: @LIBGC@
build/$(LIB_OMC)/libomcgc.so: 3rdParty/gc/.libs/libomcgc.so
mkdir -p build/$(LIB_OMC)
cp -pPR $< $<.* build/$(LIB_OMC)/
3rdParty/gc/.libs/libomcgc.so: 3rdParty/gc/Makefile
$(MAKE) -C 3rdParty/gc/ libomcgc.la
omc-bootstrapped:
$(MAKE) mkbuilddirs
$(MAKE) bootstrap-dependencies interactive sim-dependencies
$(MAKE) -C Compiler/boot
omc-no-sim:
$(MAKE) bootstrap-dependencies interactive-short
$(MAKE) -C Compiler/boot
$(MAKE) omlibrary
fake_modelica3d:
# create fake files for debian package
mkdir -p $(DESTDIR)/usr/$(LIB_OMC) $(DESTDIR)/usr/lib/omlibrary-modelica3d
echo "void fake(void){}" | $(CC) -c -x c - -fPIC -o fake.o
$(CC) -shared fake.o -o $(DESTDIR)/usr/lib/libhuhu.so
ar r $(DESTDIR)/usr/$(LIB_OMC)/libmodbus.a fake.o
ar r $(DESTDIR)/usr/$(LIB_OMC)/libmodcount.a fake.o
touch $(DESTDIR)/usr/lib/omlibrary-modelica3d/.empty-dir
rm fake.o
modelica3d:
ifeq (@MODELICA3D@,)
@echo Skipping Modelica3D
else
cd 3rdParty/modelica3d && mkdir -p build
cd 3rdParty/modelica3d/build && $(CMAKE_RPATH) -DCMAKE_VERBOSE_MAKEFILE:Bool=ON -DCMAKE_COLOR_MAKEFILE:Bool=OFF -DOSG_BACKEND=1 -DUSE_OMC=0 $(BOOST_INCLUDE) ..
$(MAKE) -C 3rdParty/modelica3d/build
cp -p 3rdParty/modelica3d/build/backends/osg-gtk/libm3d-osg-gtk$(SHREXT) 3rdParty/modelica3d/build/lib/proc3d/libproc3d$(SHREXT) build/lib/@host_short@
test ! `uname` = Darwin || install_name_tool -id @rpath/libproc3d.dylib build/lib/@host_short@/libproc3d.dylib
test ! `uname` = Darwin || install_name_tool -id @rpath/libm3d-osg-gtk.dylib build/lib/@host_short@/libm3d-osg-gtk.dylib
test ! `uname` = Darwin || install_name_tool -change "`pwd`/3rdParty/modelica3d/build/lib/proc3d/libproc3d.dylib" "@rpath/libproc3d.dylib" build/lib/@host_short@/libm3d-osg-gtk.dylib
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/src
# 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 && autoconf && ./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/ `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 '/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.ac
autoconf
emcc: msl-external-libs-emcc emcc-simulationruntime
emcc-simulationruntime:
mkdir -p build/lib/omc/emcc/
$(MAKE) -C SimulationRuntime/c emcc
copycppheader: