写在20110619:Android.mk编写格式

LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

LOCAL_MODULE_TAGS := optional            (模式:user eng optional)

LOCAL_STATIC_JAVA_LIBRARIES := libA libB libC   (外部库自定义名称,与后面对应)
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_SRC_FILES += \
    aidl文件路径\Interface_Name.aidl    (外部aidl)

LOCAL_PACKAGE_NAME := Project_Name
LOCAL_CERTIFICATE := shared  (4.2之后的其他应用需要访问需要互相签名)

LOCAL_JAVA_LIBRARIES := 系统内部库名称
LOCAL_JAVA_LIBRARIES += 系统内部库名称  (后面加“\”回车可以继续添加)

LOCAL_PROGUARD_ENABLED := disabled    (禁止编译优化)
LOCAL_SDK_VERSION := current   (当前SDK版本)

include $(BUILD_PACKAGE)


LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := libA:libs/×××外部包1.jar
LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES += \
libB:libs/×××外部包2.jar \
libC:libs/×××外部包3.jar

include $(BUILD_MULTI_PREBUILT)

# Use the following include to make our test apk.
include $(call all-makefiles-under,$(LOCAL_PATH))


不想把某个应用编译进去,只需在该应用的Android.mk中更改语句
ifneq($TARGET_PRODUCT,Project_Name)
……
endif

你可能感兴趣的:(android)