• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/sh
2#
3#    out-of-build-tree script.
4#
5#    Copyright (C) 2010, Cisco Systems Inc.
6#
7#    This program is free software; you can redistribute it and/or modify
8#    it under the terms of the GNU General Public License as published by
9#    the Free Software Foundation; either version 2 of the License, or
10#    (at your option) any later version.
11#
12#    This program is distributed in the hope that it will be useful,
13#    but WITHOUT ANY WARRANTY; without even the implied warranty of
14#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15#    GNU General Public License for more details.
16#
17#    You should have received a copy of the GNU General Public License along
18#    with this program; if not, write to the Free Software Foundation, Inc.,
19#    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20#
21# Ngie Cooper, January 2010
22
23export PATH="${0%/*}:$PATH"
24
25set -e
26. build_test_function.sh
27
28# 0. Setup the environment.
29setup_env "Build out of build tree"
30# 1. Pull the SCM.
31pull_scm git "$tmp_srcdir"
32# 2. Pre-configure clean sanity.
33# i.   Is srcdir still there (should be)?
34# ii.  Is builddir there (shouldn't be)?
35# iii. Is $DESTDIR/$prefix there (shouldn't be)?
36clean_is_sane "$srcdir" "$tmp_builddir" "$("$abspath" "$tmp_destdir/$tmp_prefix")"
37[ -d "$srcdir" -a ! -d "$tmp_builddir" -a ! -d "$tmp_destdir/$tmp_prefix" ]
38# 3. Configure.
39configure "$srcdir" "$tmp_builddir" "$tmp_prefix"
40# 4. -->> Compile out-of-build-tree. <<--
41build "$srcdir" "$tmp_builddir"
42# 5. Install.
43install_ltp "$srcdir" "$tmp_builddir" "$tmp_destdir"
44# 6. Test.
45test_ltp "$("$abspath" "$tmp_destdir/$tmp_prefix")"
46# 7. Post-test clean sanity.
47# i.   Is srcdir still there (should be)?
48# ii.  Is builddir there (shouldn't be)?
49# iii. Is $DESTDIR/$prefix there (shouldn't be)?
50clean_is_sane "$srcdir" "$tmp_builddir" "$("$abspath" "$tmp_destdir/$tmp_prefix")"
51[ -d "$srcdir" -a ! -d "$tmp_builddir" -a ! -d "$tmp_destdir/$tmp_prefix" ]
52