-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile.common
208 lines (173 loc) · 8.41 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
inclu.PHONY : all omc omcd debug release mosh clean .testvariables mkbuilddirs all omc omcd debug release mosh clean qtclean qtclean-common difftool
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/
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
.PHONY : interactive omc omcd release debug qtclient mosh all mkbuilddirs fmi test install-dirs susan susan_all susgen sustst install-python install-openturns runtimeCPPinstall
mkbuilddirs:
if [ "$(EXE)" = ".app" ]; then mkdir -p $(builddir_app); fi
mkdir -p $(builddir_bin)
mkdir -p $(builddir_lib)/omc
mkdir -p $(builddir_lib)/omc/libexec
mkdir -p $(builddir_lib)/python
mkdir -p $(builddir_lib)/python/omniORB
mkdir -p $(builddir_inc)
mkdir -p $(builddir_java)
mkdir -p $(builddir_share)/omc/scripts/PythonInterface/OMPython/OMParser
mkdir -p $(builddir_share)/omc/scripts/OpenTurns/
mkdir -p $(builddir_share)/omnotebook
mkdir -p $(builddir_doc)/omc/testmodels
mkdir -p $(builddir_man)/man1/
debug: .testvariables mkbuilddirs settings omcd
profiler: .testvariables mkbuilddirs settings omc_profiler
release: omc
install-python:
(time $(MAKE) -C PythonInterface -f $(defaultMakefileTarget))
install-openturns: mkbuilddirs
(time cp SimulationRuntime/OpenTurns/* $(builddir_share)/omc/scripts/OpenTurns/)
interactive: .testvariables mkbuilddirs
$(MAKE) -C SimulationRuntime/interactive -f $(defaultMakefileTarget)
# Depends on libinteractive.a
$(MAKE) -C SimulationRuntime/c -f $(defaultMakefileTarget)
docs: mkbuilddirs omlibrary
(cp -p doc/*.pdf doc/*.txt doc/OpenModelicaAPI-Howto/*.pdf $(builddir_doc)/omc)
rm -f build/doc/omc/CMakeLists.txt
(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 gzip $$f -c > ../../$(builddir_man)/man1/$$f.gz && touch -r $$f ../../$(builddir_man)/man1/$$f.gz; done)
fmi: interactive
$(MAKE) -C SimulationRuntime/fmi/import -f $(defaultMakefileTarget)
(cp -p SimulationRuntime/fmi/import/fmuWrapper.h SimulationRuntime/fmi/import/xmlparser.h $(builddir_inc))
fmiclean:
$(MAKE) -C SimulationRuntime/fmi/import/ -f $(defaultMakefileTarget) clean
breakprocess:
(cd testsuite/bootstrapping; time g++ BreakProcess.cpp -o BreakProcess -static-libgcc)
(cd testsuite/bootstrapping; cp BreakProcess.exe ../../$(builddir_bin)/)
runtimeCPP:
(cd SimulationRuntime/cpp/; $(MAKE) -f $(defaultMakefileTarget))
runtimeCPPinstall:
(cd SimulationRuntime/cpp/; $(MAKE) -f $(defaultMakefileTarget) install)
(cd testsuite/cppruntime; time $(MAKE) -f Makefile)
runtimeCPPclean:
(cd SimulationRuntime/cpp/; $(MAKE) -f $(defaultMakefileTarget) clean)
testfast: test
test:
(cd testsuite; time $(MAKE) -f Makefile)
testlog:
(cd testsuite; time $(MAKE) -f Makefile > testsuite-trace.txt 2>&1)
echo "log is in testsuite/testsuite-trace.txt"
echo "Failed models: "
cat testsuite/testsuite-trace.txt | grep "==== Log" | wc -l
cat testsuite/testsuite-trace.txt | grep "==== Log" ; echo DONE!
testmos:
(cd testsuite/mosfiles; time $(MAKE) -f Makefile)
testsimulation:
(cd testsuite; time $(MAKE) -f Makefile simulation)
testmo:
(cd testsuite/mofiles; time $(MAKE) -f Makefile test)
testmeta:
(cd testsuite/meta; time $(MAKE) -f Makefile)
(cd testsuite/records; time $(MAKE) -f Makefile)
testboot:
(cd testsuite/bootstrapping; time ../../build/bin/omc MainTest.mos)
t:
(cd testsuite/meta; time ../rtest -v SimplifyTest.mos)
testlibraries:
(cd testsuite/libraries; time $(MAKE) -f Makefile)
testlibrariemsl31:
(cd testsuite/libraries/msl31/simulate; time $(MAKE) -f Makefile > testsuite-msl31-trace.txt 2>&1)
echo "log is in testsuite/libraries/msl31/simulate/testsuite-msl31-trace.txt"
testfmi:
(cd testsuite/fmi; time $(MAKE) -f Makefile)
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)
omlibrary: build/lib/omlibrary/stamp
build/lib/omlibrary/stamp: libraries/README
rm -rf build/lib/omlibrary
(cd libraries/ && find . -type d -not -path "*svn*" -exec install -m755 -d ../build/lib/omlibrary/{} \;)
(cd libraries/ && find . -type f -not -path "*svn*" -exec install -m644 {} ../build/lib/omlibrary/{} \;)
touch $@
distclean: clean
(cd Compiler && $(MAKE) -f $(defaultMakefileTarget) reallyclean)
(cd Compiler/omc_debug && $(MAKE) -f $(defaultMakefileTarget) reallyclean)
(cd Compiler/omc_release && $(MAKE) -f $(defaultMakefileTarget) reallyclean)
(cd Compiler/omc_profiler && $(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/
clean: qtclean
(cd SimulationRuntime/c && $(MAKE) -f $(defaultMakefileTarget) clean)
(cd SimulationRuntime/interactive && $(MAKE) -f $(defaultMakefileTarget) clean)
(cd Compiler && $(MAKE) -f $(defaultMakefileTarget) clean)
(cd Compiler/omc_debug && $(MAKE) -f $(defaultMakefileTarget) clean)
(cd Compiler/omc_release && $(MAKE) -f $(defaultMakefileTarget) clean)
(cd Compiler/omc_profiler && $(MAKE) -f $(defaultMakefileTarget) clean)
(cd mosh/src && $(MAKE) -f $(defaultMakefileTarget) clean)
(cd PythonInterface && $(MAKE) -f $(defaultMakefileTarget) clean)
rm -rf build/share build/lib build/include build/bin/OMShell* build/bin/OMNotebook* \
build/bin/omc build/bin/omc.exe build/bin/omcd build/bin/omcd.exe build/bin/omcp build/bin/omcp.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 [ "$(EXE)" = ".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/
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 [ "$(EXE)" = ".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 -p ${builddir_inc}/* ${INSTALL_INCLUDEDIR}
# 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/* ${INSTALL_SHAREDIR}/omc/scripts
# Java
cp -p ${builddir_java}/* ${INSTALL_JAVADIR}