android源码下编译自有工程通用make模板

android 源码下建立自有工程下编译

1、source build/envsetup.sh

下面列出一个通用makefile模板

# This makefile supplies the rules for building a library of JNI code for
 
# use by our example of how to bundle a shared library with an APK.
 
LOCAL_PATH:= $(call my-dir)
 
tw_module_tags := eng debug
 
include $(CLEAR_VARS)
 
LOCAL_MODULE_TAGS := $(tw_module_tags)
 
# This is the target being built.
LOCAL_MODULE:= libmyhello
 
#the target platform
#TARGET_PLATFORM := android-4
# All of the source files that we will compile.
LOCAL_SRC_FILES:= \
com_wonder_MyJniAppActivity.h calllocal.c
#system lib to use log
#LOCAL_LDLIBS+= -L$(SYSROOT)/system/lib -llog
# All of the shared libraries we link against.
LOCAL_SHARED_LIBRARIES := \
liblog
 
# No static libraries.
LOCAL_STATIC_LIBRARIES :=
# Also need the JNI headers.
LOCAL_C_INCLUDES += \
$(JNI_H_INCLUDE)
 
LOCAL_ARM_MODE := arm
# No special compiler flags.
LOCAL_CFLAGS +=
 
# Don't prelink this library. For more efficient code, you may want
# to add this library to the prelink map and set this to true. However,
# it's difficult to do this for applications that are not supplied as
# part of a system image.
 
LOCAL_PRELINK_MODULE := false
 
include $(BUILD_SHARED_LIBRARY)
posted @ 2012-07-03 10:35  xianyuan  阅读(212)  评论(0编辑  收藏  举报