blob: b4717e0803a88d4b0cda7f58678b77a0bd6ce4d4 [file] [log] [blame]
The Android Open Source Project88b60792009-03-03 19:28:42 -08001###########################################################
2## Standard rules for copying files that are prebuilt
3##
4## Additional inputs from base_rules.make:
5## None.
Doug Zongker1046d202009-08-06 13:02:19 -07006##
The Android Open Source Project88b60792009-03-03 19:28:42 -08007###########################################################
8
9ifneq ($(LOCAL_PREBUILT_LIBS),)
10$(error dont use LOCAL_PREBUILT_LIBS anymore LOCAL_PATH=$(LOCAL_PATH))
11endif
12ifneq ($(LOCAL_PREBUILT_EXECUTABLES),)
13$(error dont use LOCAL_PREBUILT_EXECUTABLES anymore LOCAL_PATH=$(LOCAL_PATH))
14endif
15ifneq ($(LOCAL_PREBUILT_JAVA_LIBRARIES),)
16$(error dont use LOCAL_PREBUILT_JAVA_LIBRARIES anymore LOCAL_PATH=$(LOCAL_PATH))
17endif
18
19include $(BUILD_SYSTEM)/base_rules.mk
20
21# Deal with the OSX library timestamp issue when installing
22# a prebuilt simulator library.
23ifneq ($(filter STATIC_LIBRARIES SHARED_LIBRARIES,$(LOCAL_MODULE_CLASS)),)
24 prebuilt_module_is_a_library := true
25else
26 prebuilt_module_is_a_library :=
27endif
28
Owen Lin64d5a802009-10-16 02:43:05 -070029PACKAGES.$(LOCAL_MODULE).OVERRIDES := $(strip $(LOCAL_OVERRIDES_PACKAGES))
30
Dianne Hackborn9c0c4b72009-08-11 19:16:46 -070031# Ensure that prebuilt .apks have been aligned.
32ifneq ($(filter APPS,$(LOCAL_MODULE_CLASS)),)
33$(LOCAL_BUILT_MODULE) : $(LOCAL_PATH)/$(LOCAL_SRC_FILES) | $(ZIPALIGN)
34 $(transform-prebuilt-to-target-with-zipalign)
35else
Doug Zongker1046d202009-08-06 13:02:19 -070036ifneq ($(LOCAL_PREBUILT_STRIP_COMMENTS),)
37$(LOCAL_BUILT_MODULE) : $(LOCAL_PATH)/$(LOCAL_SRC_FILES)
38 $(transform-prebuilt-to-target-strip-comments)
39else
The Android Open Source Project88b60792009-03-03 19:28:42 -080040$(LOCAL_BUILT_MODULE) : $(LOCAL_PATH)/$(LOCAL_SRC_FILES) | $(ACP)
41 $(transform-prebuilt-to-target)
Doug Zongker1046d202009-08-06 13:02:19 -070042endif
Dianne Hackborn9c0c4b72009-08-11 19:16:46 -070043endif
44
Ying Wanga83940f2010-09-24 18:09:04 -070045ifeq ($(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.
48common_library_jar := $(call intermediates-dir-for,JAVA_LIBRARIES,$(LOCAL_MODULE),,COMMON)/$(notdir $(LOCAL_BUILT_MODULE))
49$(common_library_jar) : $(LOCAL_PATH)/$(LOCAL_SRC_FILES) | $(ACP)
50 $(transform-prebuilt-to-target)
51endif
52
Doug Zongkerf6a53aa2009-12-15 15:06:55 -080053ifeq ($(LOCAL_CERTIFICATE),EXTERNAL)
54 # The magic string "EXTERNAL" means this package will be signed with
55 # the test key throughout the build process, but we expect the final
56 # package to be signed with a different key.
57 #
58 # This can be used for packages where we don't have access to the
59 # keys, but want the package to be predexopt'ed.
60 LOCAL_CERTIFICATE := testkey
61 PACKAGES.$(LOCAL_MODULE).EXTERNAL_KEY := 1
62endif
Doug Zongker1b6d0a62009-08-26 18:22:43 -070063ifeq ($(LOCAL_CERTIFICATE),)
Doug Zongker45302ff2009-12-11 13:50:35 -080064 ifneq ($(filter APPS,$(LOCAL_MODULE_CLASS)),)
65 # It is now a build error to add a prebuilt .apk without
66 # specifying a key for it.
67 $(error No LOCAL_CERTIFICATE specified for prebuilt "$(LOCAL_SRC_FILES)")
68 endif
69else ifeq ($(LOCAL_CERTIFICATE),PRESIGNED)
70 # The magic string "PRESIGNED" means this package is already checked
71 # signed with its release key.
Doug Zongker714111c2009-12-14 09:56:19 -080072 #
73 # By setting .CERTIFICATE but not .PRIVATE_KEY, this package will be
74 # mentioned in apkcerts.txt (with certificate set to "PRESIGNED")
75 # but the dexpreopt process will not try to re-sign the app.
76 PACKAGES.$(LOCAL_MODULE).CERTIFICATE := PRESIGNED
77 PACKAGES := $(PACKAGES) $(LOCAL_MODULE)
Doug Zongker1b6d0a62009-08-26 18:22:43 -070078else
Doug Zongker45302ff2009-12-11 13:50:35 -080079 # If this is not an absolute certificate, assign it to a generic one.
80 ifeq ($(dir $(strip $(LOCAL_CERTIFICATE))),./)
81 LOCAL_CERTIFICATE := $(SRC_TARGET_DIR)/product/security/$(LOCAL_CERTIFICATE)
82 endif
Doug Zongker1b6d0a62009-08-26 18:22:43 -070083
Doug Zongker45302ff2009-12-11 13:50:35 -080084 PACKAGES.$(LOCAL_MODULE).PRIVATE_KEY := $(LOCAL_CERTIFICATE).pk8
85 PACKAGES.$(LOCAL_MODULE).CERTIFICATE := $(LOCAL_CERTIFICATE).x509.pem
86 PACKAGES := $(PACKAGES) $(LOCAL_MODULE)
Doug Zongker1b6d0a62009-08-26 18:22:43 -070087endif
88
The Android Open Source Project88b60792009-03-03 19:28:42 -080089ifneq ($(prebuilt_module_is_a_library),)
90 ifneq ($(LOCAL_IS_HOST_MODULE),)
91 $(transform-host-ranlib-copy-hack)
92 else
93 $(transform-ranlib-copy-hack)
94 endif
95endif