3e06c2c356cd6e1b4cab54bb2f970d8278505849
[ric-plt/lib/rmr.git] / test / app_test / rebuild.ksh
1 #!/usr/bin/env ksh
2 # :vi ts=4 sw=4 noet :
3 #==================================================================================
4 #    Copyright (c) 2019 Nokia
5 #    Copyright (c) 2018-2019 AT&T Intellectual Property.
6 #
7 #   Licensed under the Apache License, Version 2.0 (the "License");
8 #   you may not use this file except in compliance with the License.
9 #   You may obtain a copy of the License at
10 #
11 #       http://www.apache.org/licenses/LICENSE-2.0
12 #
13 #   Unless required by applicable law or agreed to in writing, software
14 #   distributed under the License is distributed on an "AS IS" BASIS,
15 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 #   See the License for the specific language governing permissions and
17 #   limitations under the License.
18 #==================================================================================
19 #
20
21 # ---------------------------------------------------------------------------------
22 #       Mnemonic:       rebuild.ksh
23 #       Abstract:       This is a simple script that will cause RMr to be rebuilt. It 
24 #                               may be invoked by any of the run_* scripts in this directory.
25 #
26 #       Date:           24 April 2019
27 #       Author:         E. Scott Daniels
28 # ---------------------------------------------------------------------------------
29
30
31 build_path=../../.build
32
33 echo "$(date) build starts" >&2
34 (
35         set -e
36         mkdir -p $build_path
37         cd ${build_path%/*}                             # cd barfs on ../../.build, so we do this
38         cd ${build_path##*/}
39         cmake ..
40         make package
41 ) >/tmp/PID$$.log
42 if (( $? != 0 ))
43 then
44         cat /tmp/PID$$>log
45         echo "$(date) build failed" >&2
46         exit 1
47 fi
48 echo "$(date) build completed" >&2
49