diff options
author | Ying Wang <wangying@google.com> | 2012-10-11 12:58:27 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-10-11 12:58:27 -0700 |
commit | 95d861ed9beff9e55c3283c1fa47c84ac61fa546 (patch) | |
tree | 256c7b5d7d2d2013f5e8180eeb719d0087c93a03 | |
parent | 0743f28b0f2813ce9c93812cb212319d70734064 (diff) | |
parent | 7240549748fd4e4879009524a6d01a4c26294568 (diff) | |
download | build-95d861ed9beff9e55c3283c1fa47c84ac61fa546.zip build-95d861ed9beff9e55c3283c1fa47c84ac61fa546.tar.gz build-95d861ed9beff9e55c3283c1fa47c84ac61fa546.tar.bz2 |
am 72405497: Convert to relative path for CleanSpec.mk
* commit '7240549748fd4e4879009524a6d01a4c26294568':
Convert to relative path for CleanSpec.mk
-rw-r--r-- | core/cleanspec.mk | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/core/cleanspec.mk b/core/cleanspec.mk index a3eb7cd..444ff98 100644 --- a/core/cleanspec.mk +++ b/core/cleanspec.mk @@ -63,8 +63,27 @@ INTERNAL_CLEAN_BUILD_VERSION := 6 # NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST # ************************************************ +# Get the path of the top of the tree. +# for example: +# /home/bob/master/framework/base => /home/bob/master +# See function gettop in build/envsetup.sh. +define get-top-dir +$(if $(1),$(if $(wildcard $(1)/build/core/envsetup.mk),$(1),$(strip \ + $(call get-top-dir,$(patsubst %/,%,$(dir $(1))))))) +endef + ifneq ($(ONE_SHOT_MAKEFILE),) -cs_subdirs := $(dir $(ONE_SHOT_MAKEFILE)) +cs_subdirs := $(patsubst %/,%,$(dir $(ONE_SHOT_MAKEFILE))) +abs_cs_subdirs := $(filter /%,$(cs_subdirs)) +ifneq ($(abs_cs_subdirs),) +# Convert absolute path to relative path, e.g. when using mm. +abs_top_path := $(call get-top-dir,$(word 1,$(abs_cs_subdirs))) +cs_subdirs := $(filter-out /%,$(cs_subdirs)) \ + $(patsubst $(abs_top_path)/%,%,$(abs_cs_subdirs)) + +abs_top_path := +abs_cs_subdirs := +endif else cs_subdirs := . endif |