echo $green"Copying Source files "
- #copying source and header files
- cp $2/*.c $1/src/.
- cp $2/*/*.c $1/src/.
+ #copying common source and header files
+ cp $2/../../common/*.c $1/src/.
+ cp $2/../../common/*.h $1/inc/.
+ #copying module specific header files
cp $2/*.h $1/inc/.
cp $2/*/*.h $1/inc/.
- #copying common source and header files
- cp $2/../../common/*.c $1/src/.
- cp $2/../../common/*.h $1/inc/.
+ #copying module source files having device specific macros in CMakeLists.txt
+
+ if [ "$3" == "mobile" ]; then
+ macro="MOBILE"
+ elif [ "$3" == "wearable" ]; then
+ macro="WEARABLE"
+ fi
+
+ CmakeFlag=0
+ while read line
+ do
+ if [[ $line =~ $macro ]]
+ then
+ flag=1
+ if [ 1 == "$flag" ]; then
+ while true
+ do
+ read srcFile
+ substring=$(echo $srcFile | tail -c 3)
+ if [ "$substring" == ".c" ]; then
+ CmakeFlag=1
+ cp $2/$srcFile $1/src/.
+ fi
+ if [[ $srcFile == *"ENDIF"* ]]; then
+ flag=0
+ if [ "$5" == "utc" ]; then
+ cp $2/*core.c $1/src/.
+ else
+ cp $2/*native.c $1/src/.
+ fi
+ break
+ fi
+ done
+ fi
+ fi
+ done < $2/CMakeLists.txt
+
+ #copying module source files not having device specific macros in CMakeLists.txt
+ if [ $CmakeFlag -eq 0 ]; then
+ cp $2/*.c $1/src/.
+ cp $2/*/*.c $1/src/.
+ fi
# copying data and shared data
find $2/. -type f ! -iname "*.c" ! -iname "*.h" ! -iname "*.tpk" ! -iname "CMakeLists.txt" -exec cp {} $1/shared/res \;
function build {
if [ "$#" -eq "2" ]; then
- scripts_tpk/tpk_create.sh $1 $2 $ARCH_TYPE $PROFILE_TYPE
+ scripts_tpk/tpk_create.sh $1 $2 $ARCH_TYPE $PROFILE_TYPE | tee -a BuildLog/$1/$2.txt
elif [ "$#" -eq "1" ]; then
for module in `ls -1 src/$1/ | grep -v CMakeList`
elif [ "build" == "$1" ]; then
+ if [ -d BuildLog ];then
+ rm -rf BuildLog
+ fi
+ mkdir -p BuildLog/itc
+ mkdir -p BuildLog/ctc
+ mkdir -p BuildLog/utc
+
if [ "$#" -eq "3" ]; then
build