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"
24 --verbose verbose Makefiles
26 --release disable debug
28 --qt-creator generate build dir for qt-creator
29 --doxygen=<path> specify which binary use for doxygen
31 --builddir=<dir> the build directory
32 --prefix=<dir> the installation prefix path
33 --bindir=<dir> the installation binary path
34 --libdir=<dir> the installation library path
35 --plugindir=<dir> the installation plugin path
36 --local=<dir> the installation locale path
41 function update_install_path
()
43 eval 'if [[ -z "$'"$1"'" ]] ; then
48 until [[ $# -eq 0 ]] ;
53 MAKEOPT
="$(echo $MAKEOPT | sed s,--quiet,,g)"
74 DOXYGEN
="${1/--doxygen=/}"
77 BUILDDIR
="${1/--build-dir=/}"
80 PREFIX
="${1/--prefix=/}"
83 LIBDIR
="${1/--libdir=/}"
86 PLUGINDIR
="${1/--plugindir=/}"
89 BINDIR
="${1/--bindir=/}"
92 LOCALEDIR
="${1/--localedir=/}"
98 echo wrong argument
"$1"
105 update_install_path LIBDIR lib
106 update_install_path PLUGINDIR lib
/ozulis
107 update_install_path BINDIR bin
108 update_install_path LOCALEDIR
share
/locale
110 if ! which ccache
2>&1 >/dev
/null
; then
114 if [[ $DEBUG -eq 0 ]]; then
115 CFLAGS
="$CFLAGS -DNDEBUG -O2 -fomit-frame-pointer -ftree-vectorize"
116 CXXFLAGS
="$CXXFLAGS -DNDEBUG -O2 -fomit-frame-pointer -ftree-vectorize"
118 CFLAGS
="$CFLAGS -ggdb3"
119 CXXFLAGS
="$CXXFLAGS -ggdb3"
122 if [[ $CCACHE = "ON" ]] ; then
124 ln -sf "$(which ccache)" .ccache
/g
++
125 ln -sf "$(which ccache)" .ccache
/gcc
126 export CC
="$PWD/.ccache/gcc"
127 export CXX
="$PWD/.ccache/g++"
130 if [[ $QTCREATOR -eq 1 ]] ; then
131 CMAKE_GENERATOR
="-GCodeBlocks - Unix Makefiles"
133 CMAKE_GENERATOR
="-GUnix Makefiles"
136 CPPFLAGS
="${CPPFLAGS} -include ${ROOTDIR}/src/config.hh"
137 CFLAGS
="${CPPFLAGS} ${CFLAGS}"
138 CXXFLAGS
="${CPPFLAGS} ${CXXFLAGS}"
140 cat >src
/config.hh
<<EOF
144 # include <libintl.h>
146 # define OZULIS_BINDIR "${BINDIR}"
147 # define OZULIS_BINARY "${BINDIR}/ozulis"
148 # define OZULIS_LIBDIR "${LIBDIR}"
149 # define OZULIS_LOCALEDIR "${LOCALEDIR}"
150 # define OZULIS_PLUGINDIR "${PLUGINDIR}"
151 # define OZULIS_PREFIX "${PREFIX}"
156 # define _(Str) gettext(Str)
158 #endif /* !CONFIG_HH */
168 cmake
"$CMAKE_GENERATOR" "$ROOTDIR"
170 -DCMAKE_VERBOSE_MAKEFILE=$VERBOSE \
171 -DCMAKE_COLOR_MAKEFILE=$COLOR \
172 -DCMAKE_INSTALL_PREFIX="$PREFIX" \
182 ln -sf "$BINDIR/ozulis"
183 ln -sf "$BUILDDIR/src/moulette/moulette" moulette