callbuild.sh

jp qu, 2018-08-25 03:37

Download (854 Bytes)

 
1
#!/bin/bash
2
LOG_FLAG=1
3
ERROR_FLAG=1
4
function show_log(){
5
	if [ ${LOG_FLAG} -eq 1 ]; then
6
		echo -e "\033[32m $1 \033[0m"
7
	fi
8
}
9

    
10
function show_error(){
11
	if [ ${ERROR_FLAG} -eq 1 ]; then
12
		echo -e "\033[31m $1 \033[0m"
13
	fi
14
}
15

    
16
PWD_DIR=`pwd`
17
show_log PWD_DIR=${PWD_DIR}
18

    
19
### set project config file
20
PROJECT_NAME=3600E
21
PROJECT_ROOT_DIR=/home/yuren/3c/${PROJECT_NAME}_proj
22
PROJECT_CONFIG_FILE=${PROJECT_ROOT_DIR}/config.xml
23

    
24
### set install dir
25
BUILD_RESULT_DIR=${HOME}/build_result_3600E
26
show_log BUILD_RESULT_DIR=${BUILD_RESULT_DIR}
27
INSTALL_DIR=${BUILD_RESULT_DIR}/build_`date +%Y%m%d%H%M%S`
28
show_log INSTALL_DIR=${INSTALL_DIR}
29

    
30
mkdir -p ${INSTALL_DIR}
31

    
32
### call project build.sh & save log
33
cd ${PROJECT_ROOT_DIR}
34
#./build.sh ${PROJECT_CONFIG_FILE} ${INSTALL_DIR} > ${INSTALL_DIR}/build_log.txt
35
./build.sh ${PROJECT_CONFIG_FILE} ${INSTALL_DIR}
36

    
37
cd ${PWD_DIR}