9 MAKEOPT
="--quiet -j$(($(grep processor /proc/cpuinfo | wc -l) + 1))"
10 CPPFLAGS
="-DYYENABLE_NLS=1 -DENABLE_NLS=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
34 --local=<dir> the installation locale path
39 function update_install_path
()
41 eval 'if [[ -z "$'"$1"'" ]] ; then
46 until [[ $# -eq 0 ]] ;
51 MAKEOPT
="$(echo $MAKEOPT | sed s,--quiet,,g)"
72 BUILDDIR
="${1/--build-dir=/}"
75 PREFIX
="${1/--prefix=/}"
78 LIBDIR
="${1/--libdir=/}"
81 PLUGINDIR
="${1/--plugindir=/}"
84 BINDIR
="${1/--bindir=/}"
87 LOCALEDIR
="${1/--localedir=/}"
93 echo wrong argument
"$1"
100 update_install_path LIBDIR lib
101 update_install_path PLUGINDIR lib
/ozulis
102 update_install_path BINDIR bin
103 update_install_path LOCALEDIR
share
/locale
105 if ! which ccache
2>&1 >/dev
/null
; then
109 if [[ $DEBUG -eq 0 ]]; then
110 CFLAGS
="$CFLAGS -DNDEBUG -O2 -fomit-frame-pointer -ftree-vectorize"
111 CXXFLAGS
="$CXXFLAGS -DNDEBUG -O2 -fomit-frame-pointer -ftree-vectorize"
113 CFLAGS
="$CFLAGS -ggdb3"
114 CXXFLAGS
="$CXXFLAGS -ggdb3"
117 if [[ $CCACHE = "ON" ]] ; then
119 ln -sf "$(which ccache)" .ccache
/g
++
120 ln -sf "$(which ccache)" .ccache
/gcc
121 export CC
="$PWD/.ccache/gcc"
122 export CXX
="$PWD/.ccache/g++"
125 if [[ $QTCREATOR -eq 1 ]] ; then
126 CMAKE_GENERATOR
="-GCodeBlocks - Unix Makefiles"
128 CMAKE_GENERATOR
="-GUnix Makefiles"
131 CPPFLAGS
="${CPPFLAGS} -include ${ROOTDIR}/src/config.hh"
132 CFLAGS
="${CPPFLAGS} ${CFLAGS}"
133 CXXFLAGS
="${CPPFLAGS} ${CXXFLAGS}"
135 cat >src
/config.hh
<<EOF
139 # include <libintl.h>
141 # define OZULIS_BINDIR "${BINDIR}"
142 # define OZULIS_BINARY "${BINDIR}/ozulis"
143 # define OZULIS_LIBDIR "${LIBDIR}"
144 # define OZULIS_LOCALEDIR "${LOCALEDIR}"
145 # define OZULIS_PLUGINDIR "${PLUGINDIR}"
146 # define OZULIS_PREFIX "${PREFIX}"
151 # define _(Str) gettext(Str)
153 #endif /* !CONFIG_HH */
163 cmake
"$CMAKE_GENERATOR" "$ROOTDIR"
165 -DCMAKE_VERBOSE_MAKEFILE=$VERBOSE \
166 -DCMAKE_COLOR_MAKEFILE=$COLOR \
167 -DCMAKE_INSTALL_PREFIX="$PREFIX" \
176 ln -sf "$BINDIR/ozulis"
177 ln -sf "$BUILDDIR/src/moulette/moulette" moulette