Error if $(LOCAL_PATH) is empty

Bug: 162918277
Test: m com.android.art
Test: m MODULES-IN-art
Change-Id: I7c35dba22385e89313ea7210e9b1db15c7f6af86
diff --git a/core/base_rules.mk b/core/base_rules.mk
index abe059b..924d0ed 100644
--- a/core/base_rules.mk
+++ b/core/base_rules.mk
@@ -27,6 +27,11 @@
 ## Common instructions for a generic module.
 ###########################################################
 
+LOCAL_PATH := $(strip $(LOCAL_PATH))
+ifeq ($(LOCAL_PATH),)
+  $(error LOCAL_PATH is not defined)
+endif
+
 LOCAL_MODULE := $(strip $(LOCAL_MODULE))
 ifeq ($(LOCAL_MODULE),)
   $(error $(LOCAL_PATH): LOCAL_MODULE is not defined)