Android 編譯系統參考手冊
分類:Android Build System(MTK)build/core/clear_vars.mkClear out values of all variables used by rule templates清除LOCAL變數,每個模塊的Android.mk,一般會先包含該文件變數定義主要出現在base_rules.mk,config.mk,definitions.mkLOCAL_MODULELOCAL_MODULE表示模塊的名稱LOCAL_MODULE將在每個模塊的makefile里定義,如果未定義,編譯系統會報錯LOCAL_MODULE_PATH表示模塊編譯結果將要存放的目錄recovery模塊的Android.mk里有LOCAL_MODULE := nandroid-md5.shLOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin說明:nandroid-md5.sh 將存放於out/Cyanogenmod/target/product/m7ul/recovery/root/sbin如果模塊的Android.mk里未定義LOCAL_MODULE_PATH那麼LOCAL_MODULE_PATH := $($(my_prefix)OUT$(partition_tag)_$(LOCAL_MODULE_CLASS))在recovery模塊里recovery可執行文件相關變數如下:比如my_prefix為TARGET_,partition_tag為空,LOCAL_MODULE_CLASS為EXECUTABLES那麼LOCAL_MODULE_PATH為$(TARGET_OUT_EXECUTABLES),值應該為out/Cyanogenmod/target/product/m7ul/system/binLOCAL_MODULE_STEM表示編譯鏈接後的目標文件的文件名,不帶後綴LOCAL_MODULE_STEM := $(strip $(LOCAL_MODULE_STEM))ifeq ($(LOCAL_MODULE_STEM),)LOCAL_MODULE_STEM := $(LOCAL_MODULE)endif例:recovery模塊編譯recovery可執行文件:LOCAL_MODULE_STEM:=recoveryLOCAL_DONT_CHECK_MODULE如果定義了該變數,那麼模塊將不被檢查ifdef LOCAL_DONT_CHECK_MODULELOCAL_CHECKED_MODULE :=endifLOCAL_CHECKED_MODULE需要檢查的模塊ifndef LOCAL_CHECKED_MODULEifndef LOCAL_SDK_VERSIONLOCAL_CHECKED_MODULE := $(LOCAL_BUILT_MODULE)endifendifLOCAL_BUILT_MODULE表示編譯鏈接後的目標文件(文件路徑+文件名)LOCAL_BUILT_MODULE := $(built_module_path)/$(LOCAL_BUILT_MODULE_STEM)比如recovery:LOCAL_BUILT_MODULE 路徑;out/Cyanogenmod/target/product/m7ul/obj/EXECUTABLES/recovery_intermediates/recoveryLOCAL_BUILT_MODULE_STEM表示編譯鏈接後的目標文件的文件名,帶後綴LOCAL_BUILT_MODULE_STEM := $(strip $(LOCAL_BUILT_MODULE_STEM))ifeq ($(LOCAL_BUILT_MODULE_STEM),)LOCAL_BUILT_MODULE_STEM := $(LOCAL_INSTALLED_MODULE_STEM)endif例:recovery模塊編譯recovery可執行文件:LOCAL_INSTALLED_MODULE_STEM:=recoveryOVERRIDE_BUILT_MODULE_PATH只有內部動態鏈接庫模塊可以使用OVERRIDE_BUILT_MODULE_PATHOVERRIDE_BUILT_MODULE_PATH := $(strip $(OVERRIDE_BUILT_MODULE_PATH))ifdef OVERRIDE_BUILT_MODULE_PATHifneq ($(LOCAL_MODULE_CLASS),SHARED_LIBRARIES)$(error $(LOCAL_PATH): Illegal use of OVERRIDE_BUILT_MODULE_PATH)endifbuilt_module_path := $(OVERRIDE_BUILT_MODULE_PATH)elsebuilt_module_path := $(intermediates)endifLOCAL_INSTALLED_MODULE表示模塊的安裝路徑+文件名,存放在安裝目錄ifneq (true,$(LOCAL_UNINSTALLABLE_MODULE))LOCAL_INSTALLED_MODULE := $(LOCAL_MODULE_PATH)/$(LOCAL_INSTALLED_MODULE_STEM)endif示例:out/Cyanogenmod/target/product/m7ul/system/bin/recoveryLOCAL_UNINSTALLABLE_MODULE表示該模塊是否安裝至手機,像sdk文檔模塊不會被安裝至手機,因此LOCAL_UNINSTALLABLE_MODULE為trueLOCAL_INTERMEDIATE_TARGETSAssemble the list of targets to create PRIVATE_ variables for.LOCAL_INTERMEDIATE_TARGETS += $(LOCAL_BUILT_MODULE)LOCAL_UNSTRIPPED_PATH沒有strip的程序存放路徑,通常放在symbols目錄Instructs the build system to put the unstripped version of the module somewhereother than what"s normal for its type.Usually, you override this because you overrode LOCAL_MODULE_PATH for an executable or a sharedlibrary.If you overrode LOCAL_MODULE_PATH, but not LOCAL_UNSTRIPPED_PATH, an error will occur.LOCAL_MODULE_CLASS將用於決定編譯時的中間文件存放的位置LOCAL_MODULE_CLASS在定義目標生成方式的makefile文件里定義,比如executable.mk里定義LOCAL_MODULE_CLASS := EXECUTABLES在recovery模塊的Android.mk里定義的LOCAL_MODULE_CLASS有:LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLESLOCAL_MODULE_CLASS := UTILITY_EXECUTABLES其它的LOCAL_MODULE_CLASS有LOCAL_MODULE_CLASS := ETCLOCAL_MODULE_CLASS := STATIC_LIBRARIESLOCAL_MODULE_CLASS := EXECUTABLESLOCAL_MODULE_CLASS := FAKELOCAL_MODULE_CLASS := JAVA_LIBRARIESLOCAL_MODULE_CLASS := SHARED_LIBRARIESLOCAL_MODULE_CLASS := APPS對應 Cyanogenmod/target/product/m7ul/obj 的目錄比如說若 LOCAL_MODULE_CLASS := ETC那麼該模塊編譯的中間文件將存放於Cyanogenmod/target/product/m7ul/obj/ETCLOCAL_MODULE_SUFFIX表示編譯鏈接後的目標文件的後綴LOCAL_PACKAGE_NAMEApp名字示例: Dialer, Contacts, etc.This will probably change or go away when we switch to an ant-based build system for the apps.LOCAL_OVERRIDES_PACKAGESSome packages may override others using LOCAL_OVERRIDES_PACKAGE示例:packages/apps/DeskClock/Android.mk:13:LOCAL_OVERRIDES_PACKAGES := AlarmClockLOCAL_EXPORT_PACKAGE_RESOURCES若定義該變數,資源文件打包成一個apk示例:frameworks/base/core/res/Android.mk:34:LOCAL_EXPORT_PACKAGE_RESOURCES := trueLOCAL_MANIFEST_PACKAGE_NAME在build/core/definitions.mk里inherit-package函數有用到LOCAL_MANIFEST_PACKAGE_NAMELOCAL_REQUIRED_MODULES本模塊依賴的模塊Set LOCAL_REQUIRED_MODULES to any number of whitespace-separated module names, like "libblah" or"Email".If this module is installed, all of the modules that it requires will be installed as well.This can be used to, e.g., ensure that necessary shared librariesor providers are installed when a given app is installed示例:LOCAL_REQUIRED_MODULES += $(installed_shared_library_module_names)LOCAL_ACP_UNAVAILABLE示例:build/tools/acp/Android.mk:23:LOCAL_ACP_UNAVAILABLE := trueLOCAL_MODULE_TAGS模塊的tag,為debug eng tests optional samples shell_ash shell_mksh等tag的組合,一個模塊可有多個Tag,注意現在模塊現在不能使用user作為模塊的Tag,以前如果使用user做為tag,那麼這個模塊將被自動安裝,如果想定義自動安裝的模塊,需要在PRODUCT_PACKAGES變數里添加該模塊,該變數在build/target/product/base.mk和build/target/product/core.mk里有賦值,這是所有產品都將繼承的基礎配置另外每個設備可在自己的產品配置文件device_*.mk里設置該變數,添加更多的模塊如果當前目錄或者父目錄有*_GPL*的文件,那麼將自動添加gnu的tagLOCAL_SRC_FILES源代碼文件集合LOCAL_PREBUILT_OBJ_FILES示例:sdk/find_lock/Android.mk:50:LOCAL_PREBUILT_OBJ_FILES += images/$(FIND_LOCK_ICON_OBJ)LOCAL_STATIC_JAVA_LIBRARIES要鏈接的Java庫,被鏈接的庫將不會安裝在手機上,因此會放到鏈接生成的java包里示例:packages/apps/Exchange/Android.mk:24:LOCAL_STATIC_JAVA_LIBRARIES := android-commoncom.android.emailcommonLOCAL_STATIC_LIBRARIES表示模塊要鏈接的靜態庫ifneq (,$(filter libcutils libutils,$(LOCAL_STATIC_LIBRARIES)))LOCAL_STATIC_LIBRARIES := $(call insert-liblog,$(LOCAL_STATIC_LIBRARIES))endif示例:external/busybox/Android.mkLOCAL_STATIC_LIBRARIES := libcutils libc libm最終:LOCAL_STATIC_LIBRARIES := libcutils libc libm liblogLOCAL_GROUP_STATIC_LIBRARIES示例:build/core/binary.mk:223:ifeq (true,$(LOCAL_GROUP_STATIC_LIBRARIES))LOCAL_WHOLE_STATIC_LIBRARIES鏈接時會將LOCAL_WHOLE_STATIC_LIBRARIES類型的靜態鏈接庫的所有目標代碼放入最終目標文件里,而不去掉These are the static libraries that you want to include in your module without allowing the linkerto remove dead code from them. This is mostly useful if you want to add a static library to ashared library and have the static library"s content exposed from the shared library.ifneq (,$(filter libcutils libutils,$(LOCAL_WHOLE_STATIC_LIBRARIES)))LOCAL_WHOLE_STATIC_LIBRARIES := $(call insert-liblog,$(LOCAL_WHOLE_STATIC_LIBRARIES))endif示例:dalvik/vm/Android.mkLOCAL_WHOLE_STATIC_LIBRARIES += libexpat libcutils libdex liblog libz最終LOCAL_WHOLE_STATIC_LIBRARIES += libexpat libcutils libdex liblog libz liblogLOCAL_SHARED_LIBRARIES表示模塊要鏈接的動態鏈接庫ifneq (,$(filter libcutils libutils,$(LOCAL_SHARED_LIBRARIES)))LOCAL_SHARED_LIBRARIES := $(call insert-liblog,$(LOCAL_SHARED_LIBRARIES))endif示例:frameworks/av/media/mtp模塊Android.mk LOCAL_SHARED_LIBRARIES := libutils libcutils libusbhost libbinder最終:LOCAL_SHARED_LIBRARIES: libutils liblog libcutils libusbhost libbinderLOCAL_IS_HOST_MODULE表示該模塊是否是將在主機上運行的模塊LOCAL_CC你可以通過LOCAL_CC定義一個不同的C編譯器LOCAL_CXX你可以通過LOCAL_CXX定義一個不同的C++編譯器LOCAL_CPP_EXTENSION當前c++代碼文件後綴external/protobuf/Android.mk:177:LOCAL_CPP_EXTENSION := .ccLOCAL_NO_DEFAULT_COMPILER_FLAGS通常為C或者C++源代碼文件的編譯提供了默認的頭文件目錄和flag,可以通過LOCAL_NO_DEFAULT_COMPILER_FLAGS設置不使用這些東東LOCAL_NO_FDO_SUPPORT示例:build/core/binary.mk:136:ifeq ($(strip $(LOCAL_NO_FDO_SUPPORT)),)LOCAL_ARM_MODE示例:ndk/tests/build/build-mode/jni/Android.mk:19:LOCAL_ARM_MODE := thumbndk/tests/build/build-mode/jni/Android.mk:32:LOCAL_ARM_MODE := armLOCAL_YACCFLAGSAny flags to pass to invocations of yacc for your module.A known limitation here is that the flags will be the same for all invocations of YACC for yourmodule.This can be fixed. If you ever need it to be, just ask.LOCAL_YACCFLAGS := -p kjsyyLOCAL_ASFLAGSExplicitly declare assembly-only __ASSEMBLY__ macro forassembly sourceLOCAL_ASFLAGS += -D__ASSEMBLY__LOCAL_CFLAGS表示編譯C代碼時用的參數LOCAL_CPPFLAGS編譯C++代碼使用的flag./frameworks/av/media/libstagefright/Android.mk:78:LOCAL_CPPFLAGS += -DUSE_TI_CUSTOM_DOMXLOCAL_RTTI_FLAG編譯C++代碼使用rtti標記./external/icu4c/common/Android.mk:135:LOCAL_RTTI_FLAG := -frttiLOCAL_C_INCLUDES編譯C代碼使用的頭文件目錄LOCAL_EXPORT_C_INCLUDE_DIRS示例:system/core/libsuspend/Android.mk:18:LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/includeLOCAL_LDFLAGS表示鏈接時用的參數LOCAL_LDLIBS額外的動態鏈接庫LOCAL_LDLIBS allows you to specify additional libraries that are not part of the build for yourexecutable or library.Specify the libraries you want in -lxxx format; they"re passed directly to the link line.However, keep in mind that there will be no dependency generated for these libraries.It"s most useful in simulator builds where you want to use a library preinstalled on the host.The linker (ld) is a particularly fussy beast,so it"s sometimes necessary to pass other flags here if you"re doing something sneaky.Some examples:LOCAL_LDLIBS += -lcurses -lpthreadLOCAL_AAPT_FLAGS使用aapt編譯資源包時所用的flagpackages/apps/Calendar/Android.mk:35:LOCAL_AAPT_FLAGS := --auto-add-overlayLOCAL_AAPT_INCLUDE_ALL_RESOURCES使用AAPT編譯時需用的一個標記,打包資源時會用到該比較build/core/package.mk:391:ifeq ($(LOCAL_AAPT_INCLUDE_ALL_RESOURCES),true)packages/inputmethods/LatinIME/java/Android.mk:37:LOCAL_AAPT_INCLUDE_ALL_RESOURCES := trueLOCAL_SYSTEM_SHARED_LIBRARIESifdef LOCAL_IS_HOST_MODULEifeq ($(LOCAL_SYSTEM_SHARED_LIBRARIES),none)LOCAL_SYSTEM_SHARED_LIBRARIES :=endifelseifeq ($(LOCAL_SYSTEM_SHARED_LIBRARIES),none)LOCAL_SYSTEM_SHARED_LIBRARIES := $(TARGET_DEFAULT_SYSTEM_SHARED_LIBRARIES)endifendif示例:TARGET_DEFAULT_SYSTEM_SHARED_LIBRARIES:libc libstdc++ libmLOCAL_SYSTEM_SHARED_LIBRARIES:libc libstdc++ libmLOCAL_PREBUILT_LIBS預編譯好的庫,當使用including $(BUILD_PREBUILT) or $(BUILD_HOST_PREBUILT)會將LOCAL_PREBUILT_LIBS所指的庫拷貝到安裝目錄LOCAL_PREBUILT_EXECUTABLES預編譯好的可執行程序,一般通過include $(BUILD_PREBUILT)設置會將預編譯好的程序拷貝直接拷貝至安裝目錄LOCAL_PREBUILT_JAVA_LIBRARIES示例:prebuilts/misc/common/kxml2/Android.mk:19:LOCAL_PREBUILT_JAVA_LIBRARIES := kxml2-2.3.0$(COMMON_JAVA_PACKAGE_SUFFIX)LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES示例:packages/apps/CMUpdater/Android.mk:39:LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES :=dashclockapi:libs/dashclock-api-r1.1.jarLOCAL_PREBUILT_STRIP_COMMENTS示例:build/core/prebuilt.mk:52: ifneq ($(LOCAL_PREBUILT_STRIP_COMMENTS),)LOCAL_INTERMEDIATE_SOURCES示例:frameworks/base/Android.mk:249:LOCAL_INTERMEDIATE_SOURCES := LOCAL_INTERMEDIATE_SOURCE_DIR表示編譯生成的源文件存放目錄LOCAL_INTERMEDIATE_SOURCE_DIR := $(intermediates.COMMON)/src例:out/target/common/obj/EXECUTABLES/recovery_intermediates/srcLOCAL_JAVACFLAGSIf you have additional flags to pass into the javac compiler, add them here. For example:LOCAL_JAVACFLAGS += -Xlint:deprecationLOCAL_JAVA_LIBRARIES當鏈接java app程序和庫時, LOCAL_JAVA_LIBRARIES指定了哪些java類將被包含,目前只有 LOCAL_JAVA_LIBRARIES := core framework注意目前編譯app設置LOCAL_JAVA_LIBRARIES是不必要的,也不被允許的,在include $(BUILD_PACKAGE)時合適的庫都會被包含進來LOCAL_NO_STANDARD_LIBRARIES示例:frameworks/base/Android.mk:254:LOCAL_NO_STANDARD_LIBRARIES := trueLOCAL_CLASSPATH示例:external/javassist/Android.mk:21:LOCAL_CLASSPATH := $(HOST_JDK_TOOLS_JAR)LOCAL_DROIDDOC_USE_STANDARD_DOCLET示例:device/sample/frameworks/PlatformLibrary/Android.mk:48:LOCAL_DROIDDOC_USE_STANDARD_DOCLET := trueLOCAL_DROIDDOC_SOURCE_PATH示例:build/core/droiddoc.mk:40:LOCAL_DROIDDOC_SOURCE_PATH := $(LOCAL_PATH)LOCAL_DROIDDOC_TEMPLATE_DIR暫時未見用到LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR示例:frameworks/base/Android.mk:591:LOCAL_DROIDDOC_CUSTOM_TEMPLATE_DIR:=build/tools/droiddoc/templates-sdkLOCAL_DROIDDOC_ASSET_DIR示例:build/core/droiddoc.mk:143:$(full_target): PRIVATE_OUT_ASSET_DIR := $(out_dir)/$(LOCAL_DROIDDOC_ASSET_DIR)LOCAL_DROIDDOC_CUSTOM_ASSET_DIR示例:build/tools/droiddoc/test/stubs/Android.mk:25:LOCAL_DROIDDOC_CUSTOM_ASSET_DIR:=assets-googleLOCAL_DROIDDOC_OPTIONS示例:device/sample/frameworks/PlatformLibrary/Android.mk:46:LOCAL_DROIDDOC_OPTIONS :=com.example.android.platform_libraryLOCAL_DROIDDOC_HTML_DIR示例:frameworks/base/Android.mk:429:framework_docs_LOCAL_DROIDDOC_HTML_DIR := docs/htmlLOCAL_ASSET_FILES編譯Android Package(app)程序時,通常用LOCAL_ASSET_FILES,表示assets目錄的所有文件通常使用方式:LOCAL_ASSET_FILES += $(call find-subdir-assets)LOCAL_ASSET_DIR編譯Android Package(app)程序時,通常用LOCAL_ASSET_FILES,表示assets目錄的所有文件通常使用方式:LOCAL_ASSET_FILES += $(call find-subdir-assets)LOCAL_RESOURCE_DIR示例:packages/apps/Gallery2/Android.mk:59:LOCAL_RESOURCE_DIR += $(LOCAL_PATH)/resLOCAL_JAVA_RESOURCE_DIRS示例:frameworks/base/tools/layoutlib/bridge/Android.mk:20:LOCAL_JAVA_RESOURCE_DIRS := resourcesLOCAL_JAVA_RESOURCE_FILES示例:frameworks/base/Android.mk:261:LOCAL_JAVA_RESOURCE_FILES += $(LOCAL_PATH)/preloaded-classesLOCAL_GENERATED_SOURCES編譯時生成的源代碼文件,像aidl將轉為java代碼LOCAL_COPY_HEADERS_TO需要拷貝頭頭文件至哪個安裝目錄LOCAL_COPY_HEADERS需要拷貝至安裝目錄的頭文件集合,你需要同時定義LOCAL_COPY_HEADERS_TOLOCAL_FORCE_STATIC_EXECUTABLE強制編譯為靜態可執行文件,這樣在執行時不會去查找動態鏈接庫一般只有安裝在sbin目錄下的可執行文件使用該變數如果想程序在recovery下運行,一般都需要添加該變數示例:LOCAL_FORCE_STATIC_EXECUTABLE := trueLOCAL_ADDITIONAL_DEPENDENCIES額外的依賴If your module needs to depend on anything else that isn"t actually built in to it,you can add those make targets to LOCAL_ADDITIONAL_DEPENDENCIES.Usually this is a workaround for some other dependency that isn"t created automatically.LOCAL_ENABLE_APROF編譯動態鏈接庫時用到LOCAL_ENABLE_APROF_JNI示例:build/core/shared_library.mk:26:ifeq ($(strip $(LOCAL_ENABLE_APROF_JNI)),true)LOCAL_COMPRESS_MODULE_SYMBOLS暫未見賦值之處示例:build/core/dynamic_binary.mk:74:ifeq ($(LOCAL_COMPRESS_MODULE_SYMBOLS),true)LOCAL_STRIP_MODULE表示該模塊生成的目標是否需要被stripCalculated in base_rules.make to determine if this module should actually be stripped or not,based on whether LOCAL_STRIPPABLE_MODULE is set, and whether the combo is configured to everstrip modules.With Iliyan"s stripping tool, this might change.LOCAL_JNI_SHARED_LIBRARIES示例:packages/inputmethods/LatinIME/java/Android.mk:27:LOCAL_JNI_SHARED_LIBRARIES := libjni_latinimeLOCAL_JNI_SHARED_LIBRARIES_ABI暫未見賦值之處示例:build/core/package.mk:346: jni_shared_libraries_abi := $(LOCAL_JNI_SHARED_LIBRARIES_ABI)LOCAL_JAR_MANIFEST示例:cts/tools/dasm/src/Android.mk:24:LOCAL_JAR_MANIFEST := ../etc/manifest.txtLOCAL_INSTRUMENTATION_FOR示例:packages/apps/Gallery/tests/Android.mk:15:LOCAL_INSTRUMENTATION_FOR := GalleryLOCAL_MANIFEST_INSTRUMENTATION_FOR示例:build/core/definitions.mk:2046: $(call keep-or-override,LOCAL_MANIFEST_INSTRUMENTATION_FOR,$(patsubst &&%,%,$(word 7,$(_o)))) LOCAL_AIDL_INCLUDES示例:build/core/base_rules.mk:185:LOCAL_AIDL_INCLUDES += $(FRAMEWORKS_BASE_JAVA_SRC_DIRS)LOCAL_JARJAR_RULES示例:frameworks/base/Android.mk:263:#LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.txtbuild/core/java.mk:281:$(full_classes_jarjar_jar): PRIVATE_JARJAR_RULES := $(LOCAL_JARJAR_RULES)LOCAL_ADDITIONAL_JAVA_DIR示例:frameworks/base/Android.mk:738:LOCAL_ADDITIONAL_JAVA_DIR:=$(framework_docs_LOCAL_ADDITIONAL_JAVA_DIR)LOCAL_ALLOW_UNDEFINED_SYMBOLS示例:bionic/libthread_db/Android.mk:27:LOCAL_ALLOW_UNDEFINED_SYMBOLS := falseLOCAL_DX_FLAGS用dx處理jar代碼的flagLOCAL_CERTIFICATE簽名用的證書./device/samsung/galaxys2-common/DeviceSettings/Android.mk:11:LOCAL_CERTIFICATE := platformLOCAL_SDK_VERSIONbuild/core/java.mk里定義該變數LOCAL_SDK_VERSION := $(PDK_BUILD_SDK_VERSION)如果定義了LOCAL_SDK_VERSION,那麼需要定義ndk編譯相關變數因為編譯app時,常需要編譯jni代碼示例:LOCAL_SDK_VERSION: 9LOCAL_SDK_RES_VERSION./build/core/static_java_library.mk:62:LOCAL_SDK_RES_VERSION:=$(strip $(LOCAL_SDK_RES_VERSION))LOCAL_NDK_STL_VARIANT./packages/inputmethods/LatinIME/native/jni/Android.mk:97:LOCAL_NDK_STL_VARIANT := stlport_staticLOCAL_EMMA_INSTRUMENT使用emma進行覆蓋代碼測試./build/core/java_library.mk:54:LOCAL_EMMA_INSTRUMENT := falseLOCAL_PROGUARD_ENABLED是否啟用混淆LOCAL_PROGUARD_FLAGS混淆使用的flagLOCAL_PROGUARD_FLAG_FILES混淆使用的flag文件LOCAL_EMMA_COVERAGE_FILTER示例:packages/apps/Browser/Android.mk:20:LOCAL_EMMA_COVERAGE_FILTER := *,-com.android.common.*LOCAL_WARNINGS_ENABLE示例:build/core/definitions.mk:1468: $(if $(findstringtrue,$(LOCAL_WARNINGS_ENABLE)),$(xlint_unchecked),) LOCAL_FULL_MANIFEST_FILE示例:build/core/package.mk:63:LOCAL_FULL_MANIFEST_FILE := $(LOCAL_PATH)/$(LOCAL_MANIFEST_FILE)LOCAL_MANIFEST_FILE示例:build/core/package.mk:57:LOCAL_MANIFEST_FILE := AndroidManifest.xmlLOCAL_RENDERSCRIPT_INCLUDES示例:frameworks/base/tests/RenderScriptTests/ImageProcessing2/Android.mk:30:LOCAL_RENDERSCRIPT_INCLUDES_OVERRIDE := $(TOPDIR)external/clang/lib/Headers LOCAL_RENDERSCRIPT_INCLUDES_OVERRIDE示例:frameworks/base/tests/RenderScriptTests/ImageProcessing2/Android.mk:30:LOCAL_RENDERSCRIPT_INCLUDES_OVERRIDE := $(TOPDIR)external/clang/lib/Headers LOCAL_RENDERSCRIPT_CC示例:build/core/java.mk:161:LOCAL_RENDERSCRIPT_CC := $(LLVM_RS_CC)LOCAL_RENDERSCRIPT_FLAGS示例:frameworks/base/tests/RenderScriptTests/ImageProcessing2/Android.mk:33:LOCAL_RENDERSCRIPT_FLAGS:= -rs-package-name=android.support.v8.renderscriptLOCAL_RENDERSCRIPT_TARGET_API示例:frameworks/base/tests/RenderScriptTests/ImageProcessing2/Android.mk:29:LOCAL_RENDERSCRIPT_TARGET_API := 17LOCAL_BUILD_HOST_DEX示例:libcore/JavaLibrary.mk:137:LOCAL_BUILD_HOST_DEX := trueLOCAL_DEX_PREOPT如果編譯模式選擇的是user或者userdebug,那麼LOCAL_DEX_PREOPT默認為true,這樣資源apk和代碼文件分離成為odexbuild/core/package.mk:156:LOCAL_DEX_PREOPT := trueLOCAL_PROTOC_OPTIMIZE_TYPE示例:hardware/ril/mock-ril/Android.mk:57:LOCAL_PROTOC_OPTIMIZE_TYPE := fullLOCAL_PROTOC_FLAGS編譯.proto文件使用的flag,暫未見賦值build/core/binary.mk:291:$(proto_generated_cc_sources): PRIVATE_PROTOC_FLAGS :=$(LOCAL_PROTOC_FLAGS)LOCAL_NO_CRT示例:bionic/linker/Android.mk:70:LOCAL_NO_CRT := trueLOCAL_PROPRIETARY_MODULE是否是設備專有模塊LOCAL_MODULE_OWNER示例:vendor/samsung/galaxys2-common/proprietary/Android.mk:21:LOCAL_MODULE_OWNER := samsungLOCAL_CTS_TEST_PACKAGE示例:cts/tests/uiautomator/Android.mk:29:LOCAL_CTS_TEST_PACKAGE := android.uiautomatorLOCAL_CTS_TEST_RUNNER示例:cts/tests/tests/accessibilityservice/Android.mk:32:LOCAL_CTS_TEST_RUNNER :=com.android.cts.tradefed.testtype.AccessibilityServiceTestRunnerLOCAL_CLANG表示編譯C代碼LOCAL_ADDRESS_SANITIZER地址對齊LOCAL_JAR_EXCLUDE_FILES示例:build/core/static_java_library.mk:44:LOCAL_JAR_EXCLUDE_FILES :=$(ANDROID_RESOURCE_GENERATED_CLASSES)LOCAL_LINT_FLAGS暫未見賦值之處LOCAL_SOURCE_FILES_ALL_GENERATEDLOCAL_SOURCE_FILES_ALL_GENERATED is set only if the module does not have static source files,but generated source files in its LOCAL_INTERMEDIATE_SOURCE_DIRYou have to set up the dependency in some other way.LOCAL_DONT_DELETE_JAR_META_INF示例:cts/tests/core/ctscore.mk:24:LOCAL_DONT_DELETE_JAR_META_INF := truebuild/core/java.mk:263:$(full_classes_compiled_jar): PRIVATE_DONT_DELETE_JAR_META_INF :=$(LOCAL_DONT_DELETE_JAR_META_INF)
推薦閱讀:
※Android studio與eclipse如何共用sdk?
※為什麼手機廠商非要研發沒有原生安卓系統好用的自家系統?
※為什麼是 Samsung 而不是 Sony 成為了 Android 的王者?
※紅米適合我嗎?