forked from OpenModelica/OpenModelica
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.in
148 lines (132 loc) · 7.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
all: @ALL_TARGETS@ @OMLIBRARY_TARGET@
.PRECIOUS: Makefile
omc:
$(MAKE) -C OMCompiler @OMC_TARGET@
omlibrary-core:
$(MAKE) -C libraries BUILD_DIR=@OMBUILDDIR@/lib/omlibrary "host_short=@host_short@" "RPATH_QMAKE=@RPATH_QMAKE@ @CMAKE_LDFLAGS@" "SHREXT=@SHREXT@" core
omlibrary-all:
$(MAKE) -C libraries BUILD_DIR=@OMBUILDDIR@/lib/omlibrary "host_short=@host_short@" "RPATH_QMAKE=@RPATH_QMAKE@ @CMAKE_LDFLAGS@" "SHREXT=@SHREXT@" all
omplot: omc
$(MAKE) -C OMPlot
omedit: omc omplot
$(MAKE) -C OMEdit
omnotebook: omc omplot
$(MAKE) -C OMNotebook
omoptim: omc omplot
$(MAKE) -C OMOptim
omshell: omc
$(MAKE) -C OMShell
omc-diff:
$(MAKE) -C testsuite/difftool "OMBUILDDIR=@OMBUILDDIR@" CC="@CC@" CFLAGS="@CFLAGS@"
ReferenceFiles:
$(MAKE) -C testsuite/ReferenceFiles
testsuite-depends: omc-diff ReferenceFiles
SOURCE_DIRS_UTF8=OMEdit/ OMShell/ OMNotebook/ OMOptim/ OMPlot/ OMCompiler/Compiler/ OMCompiler/SimulationRuntime/ `bash -c echo testsuite/flattening/libraries/3rdParty/{PlanarMechanics,siemens,SiemensPower,ThermoSysPro}` testsuite/openmodelica/modelicaML testsuite/AVM testsuite/simulation
SOURCE_DIRS=$(SOURCE_DIRS_UTF8) # testsuite/flattening/libraries/3rdParty/HumMod
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
trailing-whitespace-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/|qjson-0.8.1|ParadisEO-2.0.1|OMPlot/qwt'
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 OMCompiler/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
clean:
test ! -d build || rm -r build/
for d in @subdirs@; do $(MAKE) -C $$d clean; done
LIBGITDIRS = `ls -f libraries/git`
gitclean:
git submodule foreach --recursive 'git clean -fdx -e /git -e /svn'
git clean -fdx -e OpenModelicaSetup -e .project -e .externalToolBuilders/OMDev-MINGW-OpenModelicaBuilder.launch
for d in $(LIBGITDIRS); do git clean -fdx libraries/git/$$d; done
prefix=@prefix@
exec_prefix=@exec_prefix@
datarootdir = @datarootdir@
datadir = @datadir@
bindir = @bindir@
libdir = @libdir@
includedir = @includedir@
docdir = @docdir@
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
install-dirs:
@test ! "${DESTDIR}/@prefix@" -ef "@OMBUILDDIR@" || (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 "@OMBUILDDIR@"/share/omnotebook/nls/ || mkdir -p ${INSTALL_SHAREDIR}/omnotebook/nls/
test ! -d "@OMBUILDDIR@"/share/omshell/nls/ || mkdir -p ${INSTALL_SHAREDIR}/omshell/nls/
test ! -d "@OMBUILDDIR@"/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 -a "@OMBUILDDIR@"/Applications/* $(INSTALL_APPDIR); fi
# Binaries
cp -a "@OMBUILDDIR@"/bin/* ${INSTALL_BINDIR}
# Libraries
cp -a "@OMBUILDDIR@"/lib/* ${INSTALL_LIBDIR}
# Includes
cp -a "@OMBUILDDIR@"/include/* ${INSTALL_INCLUDEDIR}
# License
cp -p OMCompiler/COPYING ${INSTALL_DOCDIR}/omc/
# Documents
test ! -e "doc" || cp -p doc/*.pdf ${INSTALL_DOCDIR}/omc/
cp -p "@OMBUILDDIR@"/share/doc/omc/testmodels/* ${INSTALL_DOCDIR}/omc/testmodels/
# man pages
# cp -p "@OMBUILDDIR@"/share/man/man1/*.gz ${INSTALL_MANDIR}/man1/
# Shared data
cp -a "@OMBUILDDIR@"/share/omc/*.* "@OMBUILDDIR@"/share/omc/runtime ${INSTALL_SHAREDIR}/omc/
test ! -d "@OMBUILDDIR@"/share/omnotebook/ || cp -rp "@OMBUILDDIR@"/share/omnotebook/* ${INSTALL_SHAREDIR}/omnotebook/
test ! -d "@OMBUILDDIR@"/share/omshell/ || cp -p "@OMBUILDDIR@"/share/omshell/*.xml ${INSTALL_SHAREDIR}/omshell/
test ! -d "@OMBUILDDIR@"/share/omshell/nls/ || cp -p "@OMBUILDDIR@"/share/omshell/nls/*.qm ${INSTALL_SHAREDIR}/omshell/nls/
test ! -d "@OMBUILDDIR@"/share/omedit/nls/ || cp -p "@OMBUILDDIR@"/share/omedit/nls/*.qm ${INSTALL_SHAREDIR}/omedit/nls/
test ! -d "@OMBUILDDIR@"/share/omnotebook/nls/ || cp -p "@OMBUILDDIR@"/share/omnotebook/nls/*.qm ${INSTALL_SHAREDIR}/omnotebook/nls/
# Scripts
cp -rp "@OMBUILDDIR@"/share/omc/scripts/*.* "@OMBUILDDIR@"/share/omc/scripts/OpenTurns ${INSTALL_SHAREDIR}/omc/scripts
# Java
cp -p "@OMBUILDDIR@"/share/omc/java/* ${INSTALL_JAVADIR}
# Translations
cp -rp "@OMBUILDDIR@"/share/locale/* ${INSTALL_LOCALEDIR}/
Makefile: Makefile.in config.status
./config.status
config.status: configure
./config.status -recheck
configure: configure.ac
autoconf