4# Copyright (C) 2017 Canonical Ltd
6# This program is free software: you can redistribute it and/or modify
7# it under the terms of the GNU General Public License version 3 as
8# published by the Free Software Foundation.
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
15# You should have received a copy of the GNU General Public License
16# along with this program. If not, see <http://www.gnu.org/licenses/>.
21NUM_JOBS=$(( `grep -c ^processor /proc/cpuinfo` + 1 ))
22CODE_DIR=$( dirname `readlink -f $0` )
25 echo "usage: build [OPTIONS] [BUILD_TYPE]\n" >&2
26 echo "Script to build the shell. If BUILD_TYPE is not specified, it defaults to \"debug\".\n" >&2
28 echo " -c, --clean Clean the build tree before building" >&2
33ARGS=`getopt -n$0 -u -a --longoptions="setup,clean,help" -o "sch" -- "$@"`
40 -c|--clean) CLEAN=true;;
50[ $# -eq 1 ] && BUILD_TYPE="$1"
53 if [ ! -f control -o $CODE_DIR/debian/control -nt control ]; then
54 sed 's/\:native//g' $CODE_DIR/debian/control > control
55 mk-build-deps --install --root-cmd sudo control
59if [ -f "/usr/bin/ccache" ] ; then
60 if [ "x$CC" = "x" ]; then
61 export CC='ccache gcc'
63 if [ "x$CXX" = "x" ] ; then
64 export CXX='ccache g++'
68if [ -f "/usr/bin/ninja" ] ; then
70 # Ninja does not need -j, it parallelizes automatically.
74 BUILD_COMMAND="make -j$NUM_JOBS"
77if $CLEAN; then rm -rf builddir; fi
81cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE $CODE_DIR ${GENERATOR} || exit 6
82${BUILD_COMMAND} || exit 7
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list