Re-organized sub-directory by category
[staging/basesystem.git] / service / system / task_manager / client / ss_data_init / mkdatainit.sh
1 #!/bin/bash
2
3 #
4 # Copyright (c) 2019-2020 TOYOTA MOTOR CORPORATION
5 #
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
9 #
10 #      http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 #
18  
19 cp tskm_data_init.cpp.in tskm_data_init.cpp.tmp
20
21 LF=$(printf '\\\012_')
22 LF=${LF%_}
23
24 for files in `ls obj/*.os`
25 do
26   serviceName=`nm -C $files | grep " T " | grep -o "tskm_[0-9a-zA-Z_]\+_data_init" | sed -e "s/^tskm_//" | sed -e "s/_data_init\$//"`
27   
28   funcname="tskm_"$serviceName"_data_init"
29   
30   echo $serviceName $funcname
31   sed -i "s/@DATA_INIT_PROT@/EFrameworkunifiedStatus $funcname(T_SS_SM_START_DataStructType* );$LF@DATA_INIT_PROT@/g" tskm_data_init.cpp.tmp
32   sed -i "s/@DATA_INIT_TABLE@/{\"$serviceName\", $funcname},$LF  @DATA_INIT_TABLE@/g" tskm_data_init.cpp.tmp
33   
34 done
35
36 sed -i "s/@DATA_INIT_PROT@//g" tskm_data_init.cpp.tmp
37 sed "s/@DATA_INIT_TABLE@/{NULL , NULL},/g" tskm_data_init.cpp.tmp > tskm_data_init.cpp
38
39 rm tskm_data_init.cpp.tmp
40
41
42
43
44
45