core: Add a phony package definition

This allows one to declare a meta-package that depends on a list
of modules. This is extremely useful for vendor provided prebulit
libraries where there is a big list of libraries/binaries to include.
Specifying that list in multiple places would be error prone and
eventually lead to very annoying bug hunts.

With a fake package, one does:

LOCAL_MODULE := my_fake_package
LOCAL_REQUIRED_MODULES := <list of required module names>
LOCAL_MODULE_TAGS := optional
include $(BUILD_PHONY_PACKAGE)

Change-Id: Idcfe91f6f2d6d886aba094981a70690e5a808bfc
Signed-off-by: Dima Zavin <dima@android.com>
This commit is contained in:
Dima Zavin 2010-09-16 00:25:16 -07:00
parent c2901aa513
commit f625bf277c
2 changed files with 19 additions and 0 deletions

View File

@ -61,6 +61,7 @@ BUILD_EXECUTABLE:= $(BUILD_SYSTEM)/executable.mk
BUILD_RAW_EXECUTABLE:= $(BUILD_SYSTEM)/raw_executable.mk
BUILD_HOST_EXECUTABLE:= $(BUILD_SYSTEM)/host_executable.mk
BUILD_PACKAGE:= $(BUILD_SYSTEM)/package.mk
BUILD_PHONY_PACKAGE:= $(BUILD_SYSTEM)/phony_package.mk
BUILD_HOST_PREBUILT:= $(BUILD_SYSTEM)/host_prebuilt.mk
BUILD_PREBUILT:= $(BUILD_SYSTEM)/prebuilt.mk
BUILD_MULTI_PREBUILT:= $(BUILD_SYSTEM)/multi_prebuilt.mk

18
core/phony_package.mk Normal file
View File

@ -0,0 +1,18 @@
LOCAL_MODULE_CLASS := _FAKE_
ifneq ($(strip $(LOCAL_SRC_FILES)),)
$(error LOCAL_SRC_FILES are not allowed for phony packages)
endif
ifeq ($(strip $(LOCAL_REQUIRED_MODULES)),)
$(error LOCAL_REQUIRED_MODULES is required for phony packages)
endif
.PHONY: $(LOCAL_MODULE)
$(LOCAL_MODULE): $(LOCAL_REQUIRED_MODULES)
ALL_MODULES += $(LOCAL_MODULE)
ALL_MODULES.$(LOCAL_MODULE).CLASS := _FAKE_
PACKAGES := $(PACKAGES) $(LOCAL_MODULE)