9 MAKEOPT
="--quiet -j$(($(grep processor /proc/cpuinfo | wc -l) + 1))"
10 CPPFLAGS
="$CPPFLAGS -DYYENABLE_NLS=1 -DENABLE_NLS=1"
11 CFLAGS
="$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
="$CXXFLAGS -W -Wall -pipe -Wundef -Wshadow -Wpointer-arith -Wabi -std=c++0x -fPIC"
25 --verbose verbose Makefiles
27 --release disable debug
29 --qt-creator generate build dir for qt-creator
30 --doxygen=<path> specify which binary use for doxygen
31 --boost-lib-suffix=<suffix>
33 --builddir=<dir> the build directory
34 --prefix=<dir> the installation prefix path
35 --bindir=<dir> the installation binary path
36 --libdir=<dir> the installation library path
37 --plugindir=<dir> the installation plugin path
38 --local=<dir> the installation locale path
43 function update_install_path
()
45 eval 'if [[ -z "$'"$1"'" ]] ; then
50 until [[ $# -eq 0 ]] ;
55 MAKEOPT
="$(echo $MAKEOPT | sed s,--quiet,,g)"
76 DOXYGEN
="${1/--doxygen=/}"
79 BOOST_LIB_SUFFIX
="${1/--boost-lib-suffix=/}"
82 BUILDDIR
="${1/--build-dir=/}"
85 PREFIX
="${1/--prefix=/}"
88 LIBDIR
="${1/--libdir=/}"
91 PLUGINDIR
="${1/--plugindir=/}"
94 BINDIR
="${1/--bindir=/}"
97 LOCALEDIR
="${1/--localedir=/}"
103 echo wrong argument
"$1"
110 update_install_path LIBDIR lib
111 update_install_path PLUGINDIR lib
/ozulis
112 update_install_path BINDIR bin
113 update_install_path LOCALEDIR
share
/locale
115 if ! which ccache
2>&1 >/dev
/null
; then
119 if [[ $DEBUG -eq 0 ]]; then
120 CFLAGS
="$CFLAGS -DNDEBUG -O2 -fomit-frame-pointer -ftree-vectorize"
121 CXXFLAGS
="$CXXFLAGS -DNDEBUG -O2 -fomit-frame-pointer -ftree-vectorize"
123 CFLAGS
="$CFLAGS -ggdb3"
124 CXXFLAGS
="$CXXFLAGS -ggdb3"
127 if [[ $CCACHE = "ON" ]] ; then
129 ln -sf "$(which ccache)" .ccache
/g
++
130 ln -sf "$(which ccache)" .ccache
/gcc
131 export CC
="$PWD/.ccache/gcc"
132 export CXX
="$PWD/.ccache/g++"
135 if [[ $QTCREATOR -eq 1 ]] ; then
136 CMAKE_GENERATOR
="-GCodeBlocks - Unix Makefiles"
138 CMAKE_GENERATOR
="-GUnix Makefiles"
141 CPPFLAGS
="${CPPFLAGS} -include ${ROOTDIR}/src/config.hh"
142 CFLAGS
="${CPPFLAGS} ${CFLAGS}"
143 CXXFLAGS
="${CPPFLAGS} ${CXXFLAGS}"
145 cat >src
/config.hh
<<EOF
149 # include <libintl.h>
151 # define OZULIS_BINDIR "${BINDIR}"
152 # define OZULIS_BINARY "${BINDIR}/ozulis"
153 # define OZULIS_LIBDIR "${LIBDIR}"
154 # define OZULIS_LOCALEDIR "${LOCALEDIR}"
155 # define OZULIS_PLUGINDIR "${PLUGINDIR}"
156 # define OZULIS_PREFIX "${PREFIX}"
161 # define _(Str) gettext(Str)
163 #endif /* !CONFIG_HH */
173 cmake
"$CMAKE_GENERATOR" "$ROOTDIR"
175 -DCMAKE_VERBOSE_MAKEFILE=$VERBOSE \
176 -DCMAKE_COLOR_MAKEFILE=$COLOR \
177 -DCMAKE_INSTALL_PREFIX="$PREFIX" \
178 -DBOOST_LIB_SUFFIX="$BOOST_LIB_SUFFIX" \
188 ln -sf "$BINDIR/ozulis"
189 ln -sf "$BUILDDIR/src/moulette/moulette" moulette