SoC common : scripts :Use module dir source from build.ninja. [1/1]

PD#SWPL-177725

Problem:
Use module dir source from build.ninja.

Solution:
Use module dir source from build.ninja.

Verify:
N/A

Change-Id: I8f4403777c8c25a2ec841e2406cbdec438a46cfa
Signed-off-by: xiaohu.huang <xiaohu.huang@amlogic.com>
diff --git a/shell_functions.sh b/shell_functions.sh
index 4e42548..65c90f1 100755
--- a/shell_functions.sh
+++ b/shell_functions.sh
@@ -20,6 +20,9 @@
 - aml_cmgrep:     Greps on all local project CMakelists.txt files.
 - aml_shgrep:     Greps on all local project shell files.
 
+- aml_dirs_tracer:Trace the dependent dirs of current project.
+- aml_files_tracer:Trace the dependent files of current project.
+
 EOF
 }
 
@@ -154,3 +157,24 @@
     	\( -name '*.sh' \) -exec grep --color -n "$@" {} +
 }
 
+function aml_dirs_tracer()
+{
+    deps_file="$(aml_top)/output/$ARCH-$BOARD-$PRODUCT/$KERNEL/build.ninja"
+    if [ -f $deps_file ]; then
+        keyword="DEP_FILE ="
+        grep "$keyword" -nR "$deps_file" | sed -n 's|.*obj/\(.*\)/CMakeFiles.*|\1|p' | sort | uniq
+    else
+        echo "Not found $deps_file,make project please."
+    fi
+}
+
+function aml_files_tracer()
+{
+    deps_file="$(aml_top)/output/$ARCH-$BOARD-$PRODUCT/$KERNEL/build.ninja"
+    if [ -f $deps_file ]; then
+        keyword="DEP_FILE ="
+        grep "$keyword" -nR "$deps_file" | sort | uniq
+    else
+        echo "Not found $deps_file,make project please."
+    fi
+}