summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYing Wang <wangying@google.com>2014-03-11 18:17:42 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-03-11 18:17:42 +0000
commit009f48b00f086213ec1e2f6619b45c0291ab4f44 (patch)
treef00140a928971a3d3f98421bc4eed62304b0b37c
parent9b6fd60cf66201a90b29b92c1c2a886777a8a766 (diff)
parenta623064131f23412daa0ac4b333320e2e30d85f0 (diff)
downloadbuild-009f48b00f086213ec1e2f6619b45c0291ab4f44.zip
build-009f48b00f086213ec1e2f6619b45c0291ab4f44.tar.gz
build-009f48b00f086213ec1e2f6619b45c0291ab4f44.tar.bz2
am a6230641: am 26bcd640: Merge "Try to catch more misuse of ."
* commit 'a623064131f23412daa0ac4b333320e2e30d85f0': Try to catch more misuse of $(my-dir).
-rw-r--r--core/Makefile4
-rw-r--r--core/definitions.mk7
2 files changed, 9 insertions, 2 deletions
diff --git a/core/Makefile b/core/Makefile
index b050d3d..8add332 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -1,5 +1,9 @@
# Put some miscellaneous rules here
+# HACK: clear LOCAL_PATH from including last build target before calling
+# intermedites-dir-for
+LOCAL_PATH := $(BUILD_SYSTEM)
+
# Pick a reasonable string to use to identify files.
ifneq "" "$(filter eng.%,$(BUILD_NUMBER))"
# BUILD_NUMBER has a timestamp in it, which means that
diff --git a/core/definitions.mk b/core/definitions.mk
index e66625e..bde0678 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -118,14 +118,15 @@ endef
###########################################################
## Retrieve the directory of the current makefile
+## Must be called before including any other makefile!!
###########################################################
# Figure out where we are.
define my-dir
$(strip \
$(eval LOCAL_MODULE_MAKEFILE := $$(lastword $$(MAKEFILE_LIST))) \
- $(if $(filter $(CLEAR_VARS),$(LOCAL_MODULE_MAKEFILE)), \
- $(error LOCAL_PATH must be set before including $$(CLEAR_VARS)) \
+ $(if $(filter $(BUILD_SYSTEM)/% $(OUT_DIR)/%,$(LOCAL_MODULE_MAKEFILE)), \
+ $(error my-dir must be called before including any other makefile.) \
, \
$(patsubst %/,%,$(dir $(LOCAL_MODULE_MAKEFILE))) \
) \
@@ -154,6 +155,7 @@ endef
###########################################################
## Retrieve a list of all makefiles immediately below your directory
+## Must be called before including any other makefile!!
###########################################################
define all-subdir-makefiles
@@ -163,6 +165,7 @@ endef
###########################################################
## Look in the named list of directories for makefiles,
## relative to the current directory.
+## Must be called before including any other makefile!!
###########################################################
# $(1): List of directories to look for under this directory