我的问题的目标是知道如何创建可以构建和运行的Android.mk(makefile),这个项目结构如下。
- 图书馆(日食图书馆)
- [/数据/ projectLibrary /]
- 项目(界面)
- 包含1个静态库(lib1.jar)
- 取决于上面的库
- [/数据/ projectUI /]
- 项目(服务)
醇>
- 包含2个静态库(lib1.jar,lib2.jar)
- [/数据/ projectService /]
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_STATIC_JAVA_LIBRARIES := android-common
LOCAL_STATIC_JAVA_LIBRARIES += jsr305
LOCAL_STATIC_JAVA_LIBRARIES += android-common-chips
LOCAL_STATIC_JAVA_LIBRARIES += lib1
LOCAL_STATIC_JAVA_LIBRARIES += lib2
LOCAL_JAVA_LIBRARIES += telephony-common mms-common
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_SRC_FILES += $(call all-java-files-under, ../projectLibrary/src)
LOCAL_RESOURCE_DIR += $(LOCAL_PATH)/res
LOCAL_RESOURCE_DIR += ../projectLibrary/res
# Include res dir from chips
chips_dir := ../../../frameworks/ex/chips/res
res_dirs := $(chips_dir) res
$(shell rm -f $(LOCAL_PATH)/chips)
LOCAL_RESOURCE_DIR += $(addprefix $(LOCAL_PATH)/, $(res_dirs))
LOCAL_AAPT_FLAGS := --auto-add-overlay
LOCAL_AAPT_FLAGS += --extra-packages com.android.ex.chips
LOCAL_REQUIRED_MODULES := SoundRecorder
LOCAL_PROGUARD_FLAG_FILES := proguard.flags
LOCAL_CERTIFICATE := myCertificate
LOCAL_PACKAGE_NAME := MyAppName
include $(BUILD_PACKAGE)
# make the jni
include $(call all-makefiles-under, jni)
# make the static libs
include $(CLEAR_VARS)
LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := lib1:libs/lib1.jar
LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := lib2:libs/lib2.jar
include $(BUILD_MULTI_PREBUILT)
# make the other makefiles, if necessary
include $(call all-makefiles-under, $(LOCAL_PATH))
我已经在网上找了它,
[]的
答案 0 :(得分:2)