]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - keystone-rtos/edma3_lld.git/blob - edma3_lld_build.sh
Merge pull request #34 in PROCESSOR-SDK/edma3_lld from review_edma_release_prasad...
[keystone-rtos/edma3_lld.git] / edma3_lld_build.sh
1 #!/bin/bash
3 start_time=`date +%s`
4 export PATH=$PATH:/bin
5 date=`date '+%b_%d_%Y_%I_%M_%p'`
6 date_print=`date '+%d-%b-%Y %I:%M:%S %p'`
7 month=`date '+%b_%Y'`
8 year=`date '+%Y'`
10 git_path="/usr/bin"
12 # Get user input
13 edma_tag=$1
14 if [ "$edma_tag" == "" ]; then
15   edma_tag="j6_master"
16 fi
17 working_dir=$2
18 if [ "$working_dir" == "" ]; then
19   working_dir="/data/datalocal1_videoapps01/user/pdp_jenkin_build/edma_daily_build"
20 fi
21 edma_clone_dir=$3
22 if [ "$edma_clone_dir" == "" ]; then
23   edma_clone_dir="edma3_lld"
24 fi
25 build_examples=$4
26 if [ "$build_examples" == "" ]; then
27   build_examples="true"
28 fi
29 print_log=$5
30 if [ "$print_log" == "" ]; then
31 # If print_log is not passed default to print statistics.
32 # Pass the print_log as false to disbale print.
33   print_log="true"
34 fi
35 output_dir=$6
36 if [ "$output_dir" == "" ]; then
37   output_dir=$working_dir"/logs/"$year"/"$month"/"$date
39   # Remove any old directory
40   rm -rf $output_dir
42   # Make directory based on date
43   mkdir -p $working_dir/logs
44   mkdir -p $working_dir/logs/$year/$month
45   mkdir -p $output_dir
46 fi
48 if [ "$print_log" != "false" ]; then
49   echo "Edma3lld Build!!"
50   echo "Date              : "$date_print
51   echo "Build Log @       : "$output_dir
52   echo ""
53 fi
55 if [ "$OS" == "" ]; then
56   echo "No OS defined, defaulting to linux"
57   OS=linux
58 fi
60 if [ "$OS" == "linux" ]; then
61   gmake_cmd=make
62 else
63   gmake_cmd=gmake
64 fi
66 # Present working directory from where the script runs
67 cd $working_dir
69 edma_build_log_libs_gcc=$output_dir"/edma_build_libs_gcc.log"
70 edma_build_err_libs_gcc=$output_dir"/edma_build_err_libs_gcc.log"
72 edma_build_log_libs_all_elf=$output_dir"/edma_build_libs_all_elf.log"
73 edma_build_err_libs_all_elf=$output_dir"/edma_build_err_libs_all_elf.log"
74 edma_build_log_libs_all_coff=$output_dir"/edma_build_libs_all_coff.log"
75 edma_build_err_libs_all_coff=$output_dir"/edma_build_err_libs_all_coff.log"
77 edma_build_log_examples_all_elf=$output_dir"/edma_build_examples_all_elf.log"
78 edma_build_err_examples_all_elf=$output_dir"/edma_build_err_examples_all_elf.log"
79 edma_build_log_examples_all_coff=$output_dir"/edma_build_examples_all_coff.log"
80 edma_build_err_examples_all_coff=$output_dir"/edma_build_err_examples_all_coff.log"
82 edma_build_log_xdc_package=$output_dir"/edma_build_xdc_package.log"
83 edma_build_err_xdc_package=$output_dir"/edma_build_err_xdc_package.log"
85 # Remove any old directory
86 rm -rf $edma_clone_dir
88 print_error() {
89     file_size=$( stat -c %s "$2")
90     if [ $file_size -gt 0 ]; then
91         echo ""
92         echo ==============================================================
93         echo "Errors and Warnings for $1 Build..."
94         echo ""
95         cat "$2"
96         echo ==============================================================
97         echo ""
98     else
99         echo "$1 Build Passed!!!"
100     fi
103 cd $working_dir
105 echo "=== Cloning EDMA3 LLD Repository ..."
107 $git_path/git clone -q -b $edma_tag --single-branch ssh://git@bitbucket.itg.ti.com/processor-sdk/edma3_lld.git $edma_clone_dir
109 cd $working_dir/$edma_clone_dir
111 export ROOTDIR=$working_dir/$edma_clone_dir
113 #update the edma path and the toolchain root path
114 sed -i -e "s|INTERNAL_SW_ROOT ?= E\\:\/EDMA\/edma3_lld_02_12_01_25|INTERNAL_SW_ROOT ?= $ROOTDIR|g" makerules/env.mk
115 sed -i -e "s|EXTERNAL_SW_ROOT ?= C\\:\/PROGRA~2\/TEXASI~1|EXTERNAL_SW_ROOT ?= /datalocal1/ti_components|g" makerules/env.mk
117 # Build the libs
118 cd packages
120 $gmake_cmd -s libs PLATFORM=ti814x-evm TARGET=a8 TOOLCHAIN_a8=GCC FORMAT=ELF 1>$edma_build_log_libs_gcc 2>$edma_build_err_libs_gcc; print_error "ti814x (Gcc Toolchain) " "$edma_build_err_libs_gcc"
121 $gmake_cmd -s libs FORMAT=ELF 1>$edma_build_log_libs_all_elf 2>$edma_build_err_libs_all_elf; print_error "libs all Elf Format " "$edma_build_err_libs_all_elf"
122 $gmake_cmd -s libs FORMAT=COFF 1>$edma_build_log_libs_all_coff 2>$edma_build_err_libs_all_coff; print_error "libs all Coff Format " "$edma_build_err_libs_all_coff"
124 # Make the XDC package for the edma libs
125 export PATH=/datalocal1/ti_components/os_tools/linux/xdctools_3_32_01_22_core:$PATH
126 export XDCPATH=/datalocal1/ti_components/os_tools/bios_6_46_04_53/packages
127 export CGTOOLS=/datalocal1/ti_components/cg_tools/linux/C6000_7.4.2
128 export CGTOOLS_ELF=/datalocal1/ti_components/cg_tools/linux/C6000_7.4.2
129 export TMS470_CGTOOLS=/datalocal1/ti_components/cg_tools/linux/ti-cgt-arm_16.9.2.LTS
131 xdc .interfaces -PR . 1>$edma_build_log_xdc_package 2>$edma_build_err_xdc_package; print_error "edma xdc package create" "$edma_build_err_xdc_package"
133 rm `find . -name ".interfaces"`
134 rm `find . -name ".xdcenv.mak"`
135 rm `find . -name "package.mak"`
137 mv config.bld _config.bld
139 # Build the examples
140 if [ "$build_examples" != "false" ]; then
141  $gmake_cmd -s examples FORMAT=ELF 1>$edma_build_log_examples_all_elf 2>$edma_build_err_examples_all_elf; print_error "examples all Elf Format " "$edma_build_err_examples_all_elf"
142  $gmake_cmd -s examples FORMAT=COFF 1>$edma_build_log_examples_all_coff 2>$edma_build_err_examples_all_coff; print_error "examples all Coff Format " "$edma_build_err_examples_all_coff"
143 fi
145 end_time=`date +%s`
146 let deltatime=end_time-start_time
147 let hours=deltatime/3600
148 let minutes=deltatime/60
149 let minutes=minutes%60
150 let seconds=deltatime%60
151 if [ "$print_log" != "false" ]; then
152   printf "Execution Time: %d:%02d:%02d\n" $hours $minutes $seconds
153 fi
155 exit