forked from OpenModelica/OpenModelica
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.in
72 lines (62 loc) · 3.62 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
all: omc @OMLIBRARY_TARGET@ omc-diff omplot omnotebook omshell omedit omoptim ReferenceFiles
.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@" "SHREXT=@SHREXT@" "MODELICA3D_TARGET=@MODELICA3D_TARGET@" core
omlibrary-all:
$(MAKE) -C libraries BUILD_DIR=@OMBUILDDIR@/lib/omlibrary "host_short=@host_short@" "RPATH_QMAKE=@RPATH_QMAKE@" "SHREXT=@SHREXT@" "MODELICA3D_TARGET=@MODELICA3D_TARGET@" 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
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
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/
Makefile: Makefile.in config.status
./config.status
config.status: configure
./config.status -recheck
configure: configure.ac
autoconf