1 #!/bin/bash
2 #
3 # Software Deliverable Package creation script
4 #
5 # Copyright 2013 - 2014, Momentum Data Systems, Inc. All rights reserved.
6 #
8 set -o errexit # -e
9 #debug: uncomment below to see each commands
10 set -o xtrace # -x
11 #set -o verbose # -v
13 # ----------------------------------------------------------------
15 # Synopsis:
16 # In addition to the obvious VAR_NAME=value, 'case $COMPUTERNAME in', etc.,
17 # 1) Final output is in ${MA}/$MAF_SYSTEM_TARGET
18 # 2) Intermediate working dir is ${MA}/_alpha_source$$ where $$ is PID
19 # 3) List all available Alpha Headers here:
20 # search in special location for Alpha Header files
21 # 4) Remove known unused files here:
22 # remove unused files
23 # 5) Copy resulting files to ${MA}/$MAF_SYSTEM_TARGET/alpha
24 # 6) Copy bins to ${MA}/$MAF_SYSTEM_TARGET/bin
25 # 7) Create .hdM files here:
26 # Create .hdM file(s)
27 # 8) Zip it up:
28 # Prepare software delivery zip package
30 # ----------------------------------------------------------------
32 # Usage definitions
33 NAM0=`cygpath -a $0`
34 NAMD=${NAM0%/*}
35 NAME=${NAM0##*/}
37 #REVISION=`echo '$Revision: 1.7 $' | awk '{print $2}'`
38 #REVIDATE=`echo '$Date: 2016/08/16 12:36:08 $' | awk '{print $2}'`
39 #VERSION="$NAME revision $REVISION of $REVIDATE"
41 # ----------------------------------------------------------------
43 if [ $# != 1 ]; then
44 echo 1>&2 "usage: make_sw <project (abbreviated) name>"
45 echo 1>&2 " eg.: make_sw AVR"
46 exit 1
47 fi
49 # ----------------------------------------------------------------
51 case $COMPUTERNAME in
52 DTA0273506)
53 PASDK_ROOT_DIR=C:/ti/procsdk_audio_x_xx_xx_xx
54 ;;
55 *)
56 echo 1>&2 make_sw: COMPUTERNAME not recognized. Edit make_sw to add your computer.
57 exit 1
58 ;;
59 esac
61 TOOLS=${PASDK_ROOT_DIR}/tools
62 PA=${PASDK_ROOT_DIR}/paf/pa
63 TEST_DSP=${PASDK_ROOT_DIR}/test_dsp
65 # ----------------------------------------------------------------
67 PROJECT=${1}
69 case $PROJECT in
70 AVR)
71 PROJECT_TARGET=avr
72 ;;
73 SBR)
74 PROJECT_TARGET=sbr
75 ;;
76 *)
77 echo 1>&2 make_sw: unsupported project $PROJECT
78 exit 1
79 ;;
80 esac
82 # ----------------------------------------------------------------
83 # Recreate software delivery directory
85 cd ${TOOLS}
87 if [ -d $PROJECT_TARGET ]; then
88 # -perm +mode
89 # This is no longer supported (and has been deprecated since 2005). Use
90 # -perm /mode instead.
91 if [ -n "`find $PROJECT_TARGET -type f -perm /444`" ]; then
92 echo 1>&2 make_sw: $PROJECT_TARGET contains read-only files
93 exit 1
94 else
95 rm -r $PROJECT_TARGET
96 fi
97 fi
99 # ----------------------------------------------------------------
100 # Copy/Delog alpha files
102 ALPHA_SOURCE=_alpha_source$$
103 mkdir $ALPHA_SOURCE
105 # search in special location for Alpha Header files
106 pwd \;
107 # pwd should be tools
108 find ../paf/pa -iname "*beta.h" -exec echo >> $ALPHA_SOURCE/files.txt {} \;
109 find ../paf/pa -iname "*_a.h" -exec echo >> $ALPHA_SOURCE/files.txt {} \;
110 find ../test_dsp -iname "*_a.h" -exec echo >> $ALPHA_SOURCE/files.txt {} \;
111 # overwrite duplicates
112 find ../paf/pa/asp/ae0/alpha -iname "ae_a.h" -exec echo >> $ALPHA_SOURCE/files.txt {} \;
113 find ../paf/pa/asp/src4/alpha -iname "src_a.h" -exec echo >> $ALPHA_SOURCE/files.txt {} \;
114 find ../paf/pa/boards/d10/drivers -iname "vproccmds_a.h" -exec echo >> $ALPHA_SOURCE/files.txt {} \;
116 # Sample partial content of files.txt
117 # ../paf/pa/asp/ae0/alpha/ae_a.h
118 # <... more paf alpha header files ...>
119 # ../test_dsp/application/itopo/evmk2g/alpha/i13_a.h
120 # <... more test_dsp alpha header files ...>
122 dos2unix $ALPHA_SOURCE/files.txt
124 # copy these files to temp build dir
125 for file in $(cat $ALPHA_SOURCE/files.txt); do
126 # delog --cvs -d$ALPHA_SOURCE $file
127 cp -f $file $ALPHA_SOURCE
128 done
130 # remove unused files
131 # paf files not in use:
132 rm -vr $ALPHA_SOURCE/amix_a.h # make hDM build error, error: #error "AMIX is only tested for PAF_MAXNUMCHAN == 16"
133 rm -vr $ALPHA_SOURCE/asj_a.h # make hDM build error, Error: Symbol readASJForm is not defined in current scope
134 rm -vr $ALPHA_SOURCE/del_a.h # make hDM build error, error: #error unsupported option
135 rm -vr $ALPHA_SOURCE/fea_a.h # make hDM build error, Error: Symbol CUS_BETA_FEA is not defined in current scope
136 rm -vr $ALPHA_SOURCE/feb_a.h # make hDM build error, Error: Symbol CUS_BETA_FEB is not defined in current scope
137 rm -vr $ALPHA_SOURCE/arc_a.h # not supporting Z-topology
138 rm -vr $ALPHA_SOURCE/pa_zaa_evmda830_io_a.h # not supporting Z-topology
139 rm -vr $ALPHA_SOURCE/pa_zsa_evmda830_io_a.h # not supporting Z-topology
140 rm -vr $ALPHA_SOURCE/pa_zss_evmda830_io_a.h # not supporting Z-topology
141 rm -vr $ALPHA_SOURCE/zaa_a.h # not supporting Z-topology
142 rm -vr $ALPHA_SOURCE/zsa_a.h # not supporting Z-topology
143 rm -vr $ALPHA_SOURCE/zss_a.h # not supporting Z-topology
144 rm -vr $ALPHA_SOURCE/lgp_a.h # not supporting lgp debug ASP
145 rm -vr $ALPHA_SOURCE/mdf_a.h # not supporting mdf debug ASP
146 rm -vr $ALPHA_SOURCE/mdDeFormat_a.h # not supporting MD de-formatter ASP since not used on K2G
147 rm -vr $ALPHA_SOURCE/mdFormat_a.h # not supporting MD formatter ASP since obsolete on DA8x and not used on K2G
148 rm -vr $ALPHA_SOURCE/sigCap_a.h # not supporting sigCap debug ASP
149 rm -vr $ALPHA_SOURCE/sineProbe_a.h # not supporting sineProbe debug ASP
150 rm -vr $ALPHA_SOURCE/ass_a.h # not including since Y-topology in development
151 rm -vr $ALPHA_SOURCE/pa_y15_evmda830_io_a.h # not including since Y-topology in development
152 rm -vr $ALPHA_SOURCE/y15_a.h # not including since Y-topology in development
153 rm -vr $ALPHA_SOURCE/thxsys_a.h # not include since legacy THX untested on K2G
154 rm -vr $ALPHA_SOURCE/vproccmds_a.h # not include since not a relevant PA control interface
156 mkdir $PROJECT_TARGET
157 mkdir $PROJECT_TARGET/alpha
159 # copy from build area to production area
160 cp -f $ALPHA_SOURCE/*.h $PROJECT_TARGET/alpha
162 mkdir $PROJECT_TARGET/pyalpha
163 cp -R ${TOOLS}/pyalpha/* $PROJECT_TARGET/pyalpha
164 rm -R ${PROJECT_TARGET}/pyalpha/alpha # remove alpha subdirectory for package creation
166 rm -Rf $ALPHA_SOURCE
168 # give all permission to all
169 chmod 777 -R $PROJECT_TARGET
172 # ----------------------------------------------------------------
173 # Create .hdM file(s)
175 ALPHAFILES_A_DEST=`ls ${PROJECT_TARGET}/alpha/*_a.h | grep -v pafmac_a | grep -v paftyp_a`
177 for i in $ALPHAFILES_A_DEST; do
178 make -f ./make_sw/makefile ${i}dM
179 done
181 # ----------------------------------------------------------------
182 # Prepare software delivery zip package
184 ZIPFILE=${PROJECT_TARGET}_`date +%y%m%d`
185 echo 1>&2 Done. Zipping ${PROJECT_TARGET} into ${ZIPFILE}.zip ...
186 zip -q -r ${PROJECT_TARGET}_`date +%y%m%d`.zip $PROJECT_TARGET
187 ls -l ${ZIPFILE}.zip
189 # ----------------------------------------------------------------
190 # EOF