9 MAKEOPT
="--quiet -j$(($(grep processor /proc/cpuinfo | wc -l) + 1))"
11 CFLAGS
="-W -Wall -Wstrict-prototypes -pipe"
12 CFLAGS
="$CFLAGS -Wfloat-equal -Wundef -Wshadow -Wpointer-arith"
13 CFLAGS
="$CFLAGS -Wmissing-declarations -Wnested-externs"
14 CFLAGS
="$CFLAGS -Wmissing-prototypes -fPIC"
15 CXXFLAGS
="-W -Wall -pipe -Wundef -Wshadow -Wpointer-arith -Wabi -std=c++0x -fPIC"
23 --verbose verbose Makefiles
25 --release disable debug
27 --qt-creator generate build dir for qt-creator
29 --builddir=<dir> the build directory
30 --prefix=<dir> the installation prefix path
31 --bindir=<dir> the installation binary path
32 --libdir=<dir> the installation library path
33 --plugindir=<dir> the installation plugin path
38 function update_install_path
()
40 eval 'if [[ -z "$'"$1"'" ]] ; then
45 until [[ $# -eq 0 ]] ;
50 MAKEOPT
="$(echo $MAKEOPT | sed s,--quiet,,g)"
71 BUILDDIR
="${1/--build-dir=/}"
74 PREFIX
="${1/--prefix=/}"
77 LIBDIR
="${1/--libdir=/}"
80 PLUGINDIR
="${1/--plugindir=/}"
83 BINDIR
="${1/--bindir=/}"
89 echo wrong argument
"$1"
96 update_install_path LIBDIR lib
97 update_install_path PLUGINDIR lib
/ozulis
98 update_install_path BINDIR bin
100 if ! which ccache
2>&1 >/dev
/null
; then
104 if [[ $DEBUG -eq 0 ]]; then
105 CFLAGS
="$CFLAGS -DNDEBUG -O2 -fomit-frame-pointer -ftree-vectorize"
106 CXXFLAGS
="$CXXFLAGS -DNDEBUG -O2 -fomit-frame-pointer -ftree-vectorize"
108 CFLAGS
="$CFLAGS -ggdb3"
109 CXXFLAGS
="$CXXFLAGS -ggdb3"
112 if [[ $CCACHE = "ON" ]] ; then
114 ln -sf "$(which ccache)" .ccache
/g
++
115 ln -sf "$(which ccache)" .ccache
/gcc
116 export CC
="$PWD/.ccache/gcc"
117 export CXX
="$PWD/.ccache/g++"
120 if [[ $QTCREATOR -eq 1 ]] ; then
121 CMAKE_GENERATOR
="-GCodeBlocks - Unix Makefiles"
123 CMAKE_GENERATOR
="-GUnix Makefiles"
126 CPPFLAGS
="${CPPFLAGS} -DOZULIS_PREFIX=\\\"${PREFIX}\\\" -DOZULIS_LIBDIR=\\\"${LIBDIR}\\\" -DOZULIS_PLUGINDIR=\\\"${PLUGINDIR}\\\" -DOZULIS_BINDIR=\\\"${BINDIR}\\\""
127 CFLAGS
="${CPPFLAGS} ${CFLAGS}"
128 CXXFLAGS
="${CPPFLAGS} ${CXXFLAGS}"
137 cmake
"$CMAKE_GENERATOR" "$ROOTDIR"
139 -DCMAKE_VERBOSE_MAKEFILE=$VERBOSE \
140 -DCMAKE_COLOR_MAKEFILE=$COLOR \
141 -DCMAKE_INSTALL_PREFIX="$PREFIX" \
150 ln -sf "$BINDIR/ozulis"
151 ln -sf "$BUILDDIR/src/moulette/moulette" moulette