The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1 | ########################################################### |
| 2 | ## Standard rules for copying files that are prebuilt |
| 3 | ## |
| 4 | ## Additional inputs from base_rules.make: |
| 5 | ## None. |
Doug Zongker | 1046d20 | 2009-08-06 13:02:19 -0700 | [diff] [blame] | 6 | ## |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 7 | ########################################################### |
| 8 | |
| 9 | ifneq ($(LOCAL_PREBUILT_LIBS),) |
| 10 | $(error dont use LOCAL_PREBUILT_LIBS anymore LOCAL_PATH=$(LOCAL_PATH)) |
| 11 | endif |
| 12 | ifneq ($(LOCAL_PREBUILT_EXECUTABLES),) |
| 13 | $(error dont use LOCAL_PREBUILT_EXECUTABLES anymore LOCAL_PATH=$(LOCAL_PATH)) |
| 14 | endif |
| 15 | ifneq ($(LOCAL_PREBUILT_JAVA_LIBRARIES),) |
| 16 | $(error dont use LOCAL_PREBUILT_JAVA_LIBRARIES anymore LOCAL_PATH=$(LOCAL_PATH)) |
| 17 | endif |
| 18 | |
| 19 | include $(BUILD_SYSTEM)/base_rules.mk |
| 20 | |
| 21 | # Deal with the OSX library timestamp issue when installing |
| 22 | # a prebuilt simulator library. |
| 23 | ifneq ($(filter STATIC_LIBRARIES SHARED_LIBRARIES,$(LOCAL_MODULE_CLASS)),) |
| 24 | prebuilt_module_is_a_library := true |
| 25 | else |
| 26 | prebuilt_module_is_a_library := |
| 27 | endif |
| 28 | |
Owen Lin | 64d5a80 | 2009-10-16 02:43:05 -0700 | [diff] [blame] | 29 | PACKAGES.$(LOCAL_MODULE).OVERRIDES := $(strip $(LOCAL_OVERRIDES_PACKAGES)) |
| 30 | |
Dianne Hackborn | 9c0c4b7 | 2009-08-11 19:16:46 -0700 | [diff] [blame] | 31 | # Ensure that prebuilt .apks have been aligned. |
| 32 | ifneq ($(filter APPS,$(LOCAL_MODULE_CLASS)),) |
| 33 | $(LOCAL_BUILT_MODULE) : $(LOCAL_PATH)/$(LOCAL_SRC_FILES) | $(ZIPALIGN) |
| 34 | $(transform-prebuilt-to-target-with-zipalign) |
| 35 | else |
Doug Zongker | 1046d20 | 2009-08-06 13:02:19 -0700 | [diff] [blame] | 36 | ifneq ($(LOCAL_PREBUILT_STRIP_COMMENTS),) |
| 37 | $(LOCAL_BUILT_MODULE) : $(LOCAL_PATH)/$(LOCAL_SRC_FILES) |
| 38 | $(transform-prebuilt-to-target-strip-comments) |
| 39 | else |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 40 | $(LOCAL_BUILT_MODULE) : $(LOCAL_PATH)/$(LOCAL_SRC_FILES) | $(ACP) |
| 41 | $(transform-prebuilt-to-target) |
Doug Zongker | 1046d20 | 2009-08-06 13:02:19 -0700 | [diff] [blame] | 42 | endif |
Dianne Hackborn | 9c0c4b7 | 2009-08-11 19:16:46 -0700 | [diff] [blame] | 43 | endif |
| 44 | |
Ying Wang | a83940f | 2010-09-24 18:09:04 -0700 | [diff] [blame] | 45 | ifeq ($(LOCAL_IS_HOST_MODULE)$(LOCAL_MODULE_CLASS),JAVA_LIBRARIES) |
| 46 | # for target java libraries, the LOCAL_BUILT_MODULE is in a product-specific dir, |
| 47 | # while the deps should be in the common dir, so we make a copy in the common dir. |
Ying Wang | 5b316b6 | 2011-02-01 12:57:45 -0800 | [diff] [blame] | 48 | # For nonstatic library, $(common_javalib_jar) is the dependency file, |
| 49 | # while $(common_classes_jar) is used to link. |
| 50 | common_classes_jar := $(call intermediates-dir-for,JAVA_LIBRARIES,$(LOCAL_MODULE),,COMMON)/classes.jar |
| 51 | common_javalib_jar := $(dir $(common_classes_jar))javalib.jar |
| 52 | |
| 53 | $(common_classes_jar) : $(LOCAL_PATH)/$(LOCAL_SRC_FILES) | $(ACP) |
Ying Wang | a83940f | 2010-09-24 18:09:04 -0700 | [diff] [blame] | 54 | $(transform-prebuilt-to-target) |
Ying Wang | 5b316b6 | 2011-02-01 12:57:45 -0800 | [diff] [blame] | 55 | |
| 56 | $(common_javalib_jar) : $(common_classes_jar) | $(ACP) |
| 57 | $(transform-prebuilt-to-target) |
| 58 | |
| 59 | # make sure the classes.jar and javalib.jar are built before $(LOCAL_BUILT_MODULE) |
| 60 | $(LOCAL_BUILT_MODULE) : $(common_javalib_jar) |
| 61 | endif # TARGET JAVA_LIBRARIES |
Ying Wang | a83940f | 2010-09-24 18:09:04 -0700 | [diff] [blame] | 62 | |
Doug Zongker | f6a53aa | 2009-12-15 15:06:55 -0800 | [diff] [blame] | 63 | ifeq ($(LOCAL_CERTIFICATE),EXTERNAL) |
| 64 | # The magic string "EXTERNAL" means this package will be signed with |
| 65 | # the test key throughout the build process, but we expect the final |
| 66 | # package to be signed with a different key. |
| 67 | # |
| 68 | # This can be used for packages where we don't have access to the |
| 69 | # keys, but want the package to be predexopt'ed. |
| 70 | LOCAL_CERTIFICATE := testkey |
| 71 | PACKAGES.$(LOCAL_MODULE).EXTERNAL_KEY := 1 |
| 72 | endif |
Doug Zongker | 1b6d0a6 | 2009-08-26 18:22:43 -0700 | [diff] [blame] | 73 | ifeq ($(LOCAL_CERTIFICATE),) |
Doug Zongker | 45302ff | 2009-12-11 13:50:35 -0800 | [diff] [blame] | 74 | ifneq ($(filter APPS,$(LOCAL_MODULE_CLASS)),) |
| 75 | # It is now a build error to add a prebuilt .apk without |
| 76 | # specifying a key for it. |
| 77 | $(error No LOCAL_CERTIFICATE specified for prebuilt "$(LOCAL_SRC_FILES)") |
| 78 | endif |
| 79 | else ifeq ($(LOCAL_CERTIFICATE),PRESIGNED) |
| 80 | # The magic string "PRESIGNED" means this package is already checked |
| 81 | # signed with its release key. |
Doug Zongker | 714111c | 2009-12-14 09:56:19 -0800 | [diff] [blame] | 82 | # |
| 83 | # By setting .CERTIFICATE but not .PRIVATE_KEY, this package will be |
| 84 | # mentioned in apkcerts.txt (with certificate set to "PRESIGNED") |
| 85 | # but the dexpreopt process will not try to re-sign the app. |
| 86 | PACKAGES.$(LOCAL_MODULE).CERTIFICATE := PRESIGNED |
| 87 | PACKAGES := $(PACKAGES) $(LOCAL_MODULE) |
Doug Zongker | 1b6d0a6 | 2009-08-26 18:22:43 -0700 | [diff] [blame] | 88 | else |
Doug Zongker | 45302ff | 2009-12-11 13:50:35 -0800 | [diff] [blame] | 89 | # If this is not an absolute certificate, assign it to a generic one. |
| 90 | ifeq ($(dir $(strip $(LOCAL_CERTIFICATE))),./) |
| 91 | LOCAL_CERTIFICATE := $(SRC_TARGET_DIR)/product/security/$(LOCAL_CERTIFICATE) |
| 92 | endif |
Doug Zongker | 1b6d0a6 | 2009-08-26 18:22:43 -0700 | [diff] [blame] | 93 | |
Doug Zongker | 45302ff | 2009-12-11 13:50:35 -0800 | [diff] [blame] | 94 | PACKAGES.$(LOCAL_MODULE).PRIVATE_KEY := $(LOCAL_CERTIFICATE).pk8 |
| 95 | PACKAGES.$(LOCAL_MODULE).CERTIFICATE := $(LOCAL_CERTIFICATE).x509.pem |
| 96 | PACKAGES := $(PACKAGES) $(LOCAL_MODULE) |
Doug Zongker | 1b6d0a6 | 2009-08-26 18:22:43 -0700 | [diff] [blame] | 97 | endif |
| 98 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 99 | ifneq ($(prebuilt_module_is_a_library),) |
| 100 | ifneq ($(LOCAL_IS_HOST_MODULE),) |
| 101 | $(transform-host-ranlib-copy-hack) |
| 102 | else |
| 103 | $(transform-ranlib-copy-hack) |
| 104 | endif |
| 105 | endif |