|
This is step 1 to migrate build/ to build/kernel.
Use a consistent logic to determine ROOT_DIR:
$(gettop.sh)
to determine $ROOT_DIR. This works no matter if build/foo.sh
is a real script or a symlink to build/kernel/foo.sh. This works
no matter if build/foo.sh or build/kernel/foo.sh is invoked.
The location of gettop.sh is determined relative to realpath $0.
- For scripts under build/{kernel/,}
$($(dirname $(readlink -f $0))/gettop.sh)
- For scripts under build/{kernel/,}{static_analysis/,kleaf/}
$($(dirname $(dirname $(readlink -f $0)))/gettop.sh)
This logic does NOT apply to _setup_env.sh. Because _setup_env.sh
is `source`-ed, $0 refers to the script sourcing _setup_env.sh, which
is unknown to _setup_env.sh. Its original logic works, so preserve it.
Bug: 204425264
Test: TH
Change-Id: Ia0432c2db932234944d4828a5bf22277eb892d37
|