File: localbuild

package info (click to toggle)
desktopnova 0.8-2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 1,084 kB
  • ctags: 388
  • sloc: ansic: 3,709; python: 114; sh: 85; xml: 13; makefile: 2
file content (66 lines) | stat: -rwxr-xr-x 1,261 bytes parent folder | download | duplicates (2)
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
#! /bin/sh
# This script will build DesktopNova in a seperate dir called "build" and
# install it temporarily in "build/install"
#
# See README Section "Source from Bazaar-Branch" for more details.

BUILDDIR="build"
INSTALLDIR="install"
unset VERBOSE

display_usage ()
{
	echo "Usage:
  ./localbuild                  display usage
  ./localbuild build            complete build (with clean)
  ./localbuild build-verbose    like build, but verbose
  ./localbuild rebuild          rebuild (without clean)
  ./localbuild clean            remove build/"
}

build ()
{
	clean
	mkdir "$BUILDDIR/" && cd "$BUILDDIR/" && cmake -Wdev \
	  -D "CMAKE_INSTALL_PREFIX:STRING=$PWD/$INSTALLDIR" \
	  -D "CMAKE_BUILD_TYPE:STRING=Debug" \
	  -D "CMAKE_C_FLAGS_DEBUG:STRING=-g -Wall -Werror" \
	  -D "RELEASE_BUILD=0" \
	  $VERBOSE .. \
	  && make install
}

rebuild ()
{
	cd "$BUILDDIR/" && rm -rf "$INSTALLDIR/" && cmake -Wdev .. > /dev/null && \
	  make install > /dev/null
}

clean ()
{
	rm -rf "$BUILDDIR/"
}


if [ "$1" = "build" ]; then
	build
	exit $?
fi

if [ "$1" = "build-verbose" ]; then
	VERBOSE='-D CMAKE_VERBOSE_MAKEFILE:BOOL=ON'
	build
	exit $?
fi

if [ "$1" = "rebuild" ]; then
	rebuild
	exit $?
fi

if [ "$1" = "clean" ]; then
	clean
	exit $?
fi

display_usage