Android provides a Perbuilt compilation method to process compiled libraries or configuration files
Perbuilt: operations for independent files.
Multi_Perbuilt: For multiple files, judge multiple files, and call Prebuilt to process them sequentially.
The above is to copy the usb_modeswitch.conf file to the etc directory under OUT, which is often used to store configuration related files.
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS) \
LOCAL_MODULE := usb_modeswitch.conf \
LOCAL_MODULE_CLASS := ETC \
LOCAL_MODULE_PATH := $(TARGET_OUT)/etc \
LOCAL_SRC_FILES :=$(LOCAL_MODULE) \
include $(BUILD_PREBUILT)
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
# Module name should match apk name to be installed.
LOCAL_MODULE := LocalModuleName
LOCAL_SRC_FILES := $(LOCAL_MODULE).apk
LOCAL_MODULE_CLASS := APPS
LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
include $(BUILD_PREBUILT)
Parameter explanation
Here is Prebuilt, regardless of the situation of compiling source files.
LOCAL_MODULE: copied file name
LOCAL_MODULE_PATH: copied path
LOCAL_SRC_FILES: source file
LOCAL_MODULE_CLASS: APPS (apk file), SHARED_LIBRARIES (lib), EXECUTABLES (bin), ETC (other files)
LOCAL_MODULE_TAGS: Under what circumstances to compile the module. The tags contained in the current module, the default optional
user: the module is only compiled under user
eng: the module is compiled in eng mode
tests: the test state is compiled
optional: this module is compiled in all versions
REF:
[Android] Prebuilt precompilation_android prebuilt_Lin Duo's Blog-CSDN Blog