[TCT][scripts_tpk][Non-ACR][Modifications for device specific macros in CMakeLists...
authorAmritanshu Pandia <a.pandia1@samsung.com>
Tue, 28 Jun 2016 13:08:06 +0000 (18:38 +0530)
committerAmritanshu Pandia <a.pandia1@samsung.com>
Tue, 28 Jun 2016 13:31:42 +0000 (19:01 +0530)
Change-Id: I0d9e44857dbde8994226c531329928471b7c73f0
Signed-off-by: Amritanshu Pandia <a.pandia1@samsung.com>
scripts_tpk/tpk_create.sh
scripts_tpk/tpkbuild.sh

index c0ff64c..02c1f66 100755 (executable)
@@ -42,16 +42,56 @@ deploySourceFile() {
        
        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 \;
index e1d6646..7b1106e 100755 (executable)
@@ -85,7 +85,7 @@ function check_tc_type {
 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`
@@ -120,6 +120,13 @@ if [ -z "$1" ]; then
 
 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