diff --git a/core/base_rules.mk b/core/base_rules.mk index 29c6c7fe9..ac126a7cf 100644 --- a/core/base_rules.mk +++ b/core/base_rules.mk @@ -99,6 +99,7 @@ endif ifneq (true,$(LOCAL_UNINSTALLABLE_MODULE)) my_module_path := $(strip $(LOCAL_MODULE_PATH)) +my_module_relative_path := $(strip $(LOCAL_MODULE_RELATIVE_PATH)) ifeq ($(my_module_path),) ifdef LOCAL_IS_HOST_MODULE partition_tag := @@ -121,6 +122,9 @@ ifeq ($(my_module_path),) $(error $(LOCAL_PATH): unhandled install path "$(install_path_var) for $(LOCAL_MODULE)") endif endif +ifneq ($(my_module_relative_path),) + my_module_path := $(my_module_path)/$(my_module_relative_path) +endif endif # not LOCAL_UNINSTALLABLE_MODULE ifneq ($(strip $(LOCAL_BUILT_MODULE)$(LOCAL_INSTALLED_MODULE)),) diff --git a/core/build-system.html b/core/build-system.html index 397eef4c0..182580c95 100644 --- a/core/build-system.html +++ b/core/build-system.html @@ -383,7 +383,7 @@ the rest of them easier to read, and you can always refer back to the templates if you need them again later.
By default, on the target these are built into /system/bin, and on the
host, they're built into LOCAL_MODULE_PATH
. See
+LOCAL_MODULE_PATH
or LOCAL_MODULE_RELATIVE_PATH
. See
Putting targets elsewhere
for more.
If you have modules that normally go somewhere, and you need to have them -build somewhere else, read this. One use of this is putting files on -the root filesystem instead of where they normally go in /system. Add these -lines to your Android.mk:
+build somewhere else, read this. +If you have modules that need to go in a subdirectory of their normal +location, for example HAL modules that need to go in /system/lib/hw or +/vendor/lib/hw, set LOCAL_MODULE_RELATIVE_PATH in your Android.mk, for +example:
++LOCAL_MODULE_RELATIVE_PATH := hw ++
If you have modules that need to go in an entirely different location, for +example the root filesystem instead of in /system, add these lines to your +Android.mk:
LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN) LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED)-
For executables and libraries, you need to also specify a
-LOCAL_UNSTRIPPED_PATH
location, because on target builds, we keep
-the unstripped executables so GDB can find the symbols.
+
For executables and libraries, you need to specify a
+LOCAL_UNSTRIPPED_PATH
location if you specified a
+LOCAL_MODULE_PATH
, because on target builds, we keep
+the unstripped executables so GDB can find the symbols.
+LOCAL_UNSTRIPPED_PATH
is not necessary if you only specified
+LOCAL_MODULE_RELATIVE_PATH
.
Look in config/envsetup.make
for all of the variables defining
places to build things.
FYI: If you're installing an executable to /sbin, you probably also want to @@ -818,6 +829,13 @@ so the unstripped binary has somewhere to go. An error will occur if you forget to.
See Putting modules elsewhere for more.
+Instructs the build system to put the module in a subdirectory under the
+directory that is normal for its type. If you set this you do not need to
+set LOCAL_UNSTRIPPED_PATH
, the unstripped binaries will also use
+the relative path.
See Putting modules elsewhere for more.
+Instructs the build system to put the unstripped version of the module somewhere other than what's normal for its type. Usually, you override this diff --git a/core/clear_vars.mk b/core/clear_vars.mk index 56e17b0a3..8863fe6b8 100644 --- a/core/clear_vars.mk +++ b/core/clear_vars.mk @@ -4,6 +4,7 @@ LOCAL_MODULE:= LOCAL_MODULE_PATH:= +LOCAL_MODULE_RELATIVE_PATH := LOCAL_MODULE_STEM:= LOCAL_DONT_CHECK_MODULE:= LOCAL_CHECKED_MODULE:=