forked from haolongzhangm/shell_my
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathother_shell
executable file
·75 lines (71 loc) · 5.54 KB
/
other_shell
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/bash
function print_usage(){
echo Usage:
echo "other_shell normal_proj_tags_update : update normal cscope tags"
echo "other_shell mtk_kk_old_kernel_tags_update : update mtk old android kernel tags"
echo ===================================================================================
echo ==================calltree use command 1 ==========================================
echo "find . -name '*.c' -o -name '*.h' -o -name '*.java' -o -name '*.cpp' -o -name '*.cc' | xargs calltree -gb -np -m > tmp.dot"
echo ===================================================================================
echo ==================calltree use command 2 ==========================================
echo "calltree -gb -np lf=start_kernel KERNEL_DIR/init/*.c > tmp.dot"
echo ===================================================================================
echo =================calltree use command 3 out to dot tool ===========================
echo "add -dot parameter in command then do like this:-dot then dot -T png tmp.dot -o haolongteset.png"
echo ===================================================================================
echo ===================================================================================
echo ===================================================================================
echo ===================================================================================
echo ===================================================================================
echo ===================================================================================
echo ==========================update MTK kernel tags command===========================
echo "find mediatek/ kernel/ -name '*.c' -o -name '*.cpp' -o -name '*.h' -o -name '*.cc' -o -name '*.java' -o -name '*.sh' -o -name '*.mk' -o -name '*.prop' -o -name '*.xml' -o -name '*config*' -o -name 'Makefile' -o -name '*.rc' -o -name 'platform' -o -name 'Drivers' -o -name '*.dts' -o -name '*.dtsi' -o -name '*.te' -o -name '*.py' -o -name '*.S' -o -name '*.mak' > cscope.files ; cscope -bkq -i cscope.files ; "
echo ===================================================================================
echo ====================================================================================
echo ==========================update other tags=========================================
echo "find . -name '*.c' -o -name '*.cpp' -o -name '*.h' -o -name '*.cc' -o -name '*.java' -o -name '*.sh' -o -name '*.mk' -o -name '*.prop' -o -name '*.xml' -o -name '*config*' -o -name 'Makefile' -o -name '*.rc' -o -name 'platform' -o -name 'Drivers' -o -name '*.dts' -o -name '*.dtsi' -o -name '*.scons' -o -name '*.api' -o -name '*.tla' -o -name '*.smh' -o -name '*.smi' -o -name '*.smt' -o -name '*.idl' -o -name '*.te' -o -name '*.py' -o -name '*.S' -o -name '*.mak' > cscope.files ; cscope -bkq -i cscope.files ; "
echo ===================================================================================
echo ====================================================================================
echo 5 -- 函数被哪些地方引用 c ---
echo 6 -- c 符号被哪些地方引用 s ---
echo 7 -- 函数调用了哪些函数 d ---
echo 2 -- 文件路径 f ---
echo 10-- 字符串在哪些地方被引用 t ---
echo 12-- 跳到定义出 g ---
echo ===================================================================================
echo "old ctags command, ctags -R"
echo "you can update kernel cscope tags by ARCH eg:"
echo "make cscope ARCH=arm"
echo ===================================================================================
echo ==========================clean build android core ================================
echo "cd frameworks/base; git reset --hard ; croot; repo sync -j4; repo sync -j4; repo sync -j4; repo sync -j4; repo sync -j4; repo sync -j4; repo sync -j4; repo sync -j4; repo sync -j4; repo sync -j4; make update-api -j6 ; make -j6"
echo "7zip: 7za a -t7z -mx=5 test.7z test-dir ; 7za X test.7z"
}
if [ $# -eq 0 ]
then
echo "just show usage"
print_usage
elif [ $1 == "normal_proj_tags_update" ]
then
echo "update normal proj cscope ctags current dir"
find . -name '*.c' -o -name '*.cpp' -o -name '*.h' -o -name '*.cc' -o -name '*.java' -o -name '*.sh' -o -name '*.mk' -o -name '*.prop' -o -name '*.xml' -o -name '*config*' -o -name 'Makefile' -o -name '*.rc' -o -name 'platform' -o -name 'Drivers' -o -name '*.dts' -o -name '*.dtsi' -o -name '*.scons' -o -name '*.api' -o -name '*.tla' -o -name '*.smh' -o -name '*.smi' -o -name '*.smt' -o -name '*.idl' -o -name '*.te' -o -name '*.py' -o -name '*.S' > cscope.files
cscope -bkq -i cscope.files
elif [ $1 == "mtk_kk_old_kernel_tags_update" ]
then
echo "update mtk kk old android kernel proj cscope tags"
find mediatek/ kernel/ -name '*.c' -o -name '*.cpp' -o -name '*.h' -o -name '*.cc' -o -name '*.java' -o -name '*.sh' -o -name '*.mk' -o -name '*.prop' -o -name '*.xml' -o -name '*config*' -o -name 'Makefile' -o -name '*.rc' -o -name 'platform' -o -name 'Drivers' -o -name '*.dts' -o -name '*.dtsi' -o -name '*.te' -o -name '*.py' -o -name '*.S' > cscope.files
cscope -bkq -i cscope.files
elif [ $1 == "kernel_arm32_cscope" ]
then
echo "gen cscope tags for ARCH=arm kernel: make cscope ARCH=arm"
make cscope ARCH=arm
echo "done........................................."
elif [ $1 == "kernel_arm64_cscope" ]
then
echo "gen cscope tags for ARCH=arm64 kernel: make cscope ARCH=arm64"
make cscope ARCH=arm64
echo "done........................................."
else
print_usage
echo "Nothing DONE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
fi