Home | History | Annotate | Download | only in core
      1 ###########################################################
      2 ## Standard rules for copying files that are prebuilt
      3 ##
      4 ## Additional inputs from base_rules.make:
      5 ## None.
      6 ##
      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 
     29 PACKAGES.$(LOCAL_MODULE).OVERRIDES := $(strip $(LOCAL_OVERRIDES_PACKAGES))
     30 
     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
     36 ifneq ($(LOCAL_PREBUILT_STRIP_COMMENTS),)
     37 $(LOCAL_BUILT_MODULE) : $(LOCAL_PATH)/$(LOCAL_SRC_FILES)
     38 	$(transform-prebuilt-to-target-strip-comments)
     39 else
     40 $(LOCAL_BUILT_MODULE) : $(LOCAL_PATH)/$(LOCAL_SRC_FILES) | $(ACP)
     41 	$(transform-prebuilt-to-target)
     42 endif
     43 endif
     44 
     45 ifeq ($(LOCAL_CERTIFICATE),EXTERNAL)
     46   # The magic string "EXTERNAL" means this package will be signed with
     47   # the test key throughout the build process, but we expect the final
     48   # package to be signed with a different key.
     49   #
     50   # This can be used for packages where we don't have access to the
     51   # keys, but want the package to be predexopt'ed.
     52   LOCAL_CERTIFICATE := testkey
     53   PACKAGES.$(LOCAL_MODULE).EXTERNAL_KEY := 1
     54 endif
     55 ifeq ($(LOCAL_CERTIFICATE),)
     56   ifneq ($(filter APPS,$(LOCAL_MODULE_CLASS)),)
     57     # It is now a build error to add a prebuilt .apk without
     58     # specifying a key for it.
     59     $(error No LOCAL_CERTIFICATE specified for prebuilt "$(LOCAL_SRC_FILES)")
     60   endif
     61 else ifeq ($(LOCAL_CERTIFICATE),PRESIGNED)
     62   # The magic string "PRESIGNED" means this package is already checked
     63   # signed with its release key.
     64   #
     65   # By setting .CERTIFICATE but not .PRIVATE_KEY, this package will be
     66   # mentioned in apkcerts.txt (with certificate set to "PRESIGNED")
     67   # but the dexpreopt process will not try to re-sign the app.
     68   PACKAGES.$(LOCAL_MODULE).CERTIFICATE := PRESIGNED
     69   PACKAGES := $(PACKAGES) $(LOCAL_MODULE)
     70 else
     71   # If this is not an absolute certificate, assign it to a generic one.
     72   ifeq ($(dir $(strip $(LOCAL_CERTIFICATE))),./)
     73       LOCAL_CERTIFICATE := $(SRC_TARGET_DIR)/product/security/$(LOCAL_CERTIFICATE)
     74   endif
     75 
     76   PACKAGES.$(LOCAL_MODULE).PRIVATE_KEY := $(LOCAL_CERTIFICATE).pk8
     77   PACKAGES.$(LOCAL_MODULE).CERTIFICATE := $(LOCAL_CERTIFICATE).x509.pem
     78   PACKAGES := $(PACKAGES) $(LOCAL_MODULE)
     79 endif
     80 
     81 ifneq ($(prebuilt_module_is_a_library),)
     82   ifneq ($(LOCAL_IS_HOST_MODULE),)
     83 	$(transform-host-ranlib-copy-hack)
     84   else
     85 	$(transform-ranlib-copy-hack)
     86   endif
     87 endif
     88