如何往自己编译的opencore里面添加自己的项目。
2010-05-27 09:24
447 查看
这里分为两种情况来说,
如果你要添加lib
假设这里我们要添加一个libtest.so,按一下步骤进行
1,在opencore目录下,新建一个文件夹test,在test目录下添加build目录,在build目录下分别创建android和make两个目录,进入make目录,创建一个新文件local.mk。文件的内容按如下模版进行,也可以去其他的位置copy一份过来:
LOCAL_PATH := $(call get_makefile_dir)
include $(MK)/clear.mk
TARGET := test_lib
XINCDIRS +=
SRCDIR := ../../
INCSRCDIR :=
SRCS := test.c
LIBS
include $(MK)/library.mk
2,在build_config/opencore_dynamic/makefile里include $(MK)/cml2_shared.mk之前一行,加上
TARGET_shared += "test"
SOLIBDIRS_test="/test/build/make"
test_so_name='test'
SOLIBS_test=""
然后执行make,即可。
如果要添加一个可执行程序,local.mk的最后一行写成:include $(MK)/prog.mk
直接在build_config/opencore_dynamic/makefile里更改TESTAPPS
TESTAPPS="pvplayer_engine_test test_pvauthorengine pv2way_omx_engine_test xxxx"
然后加上
TESTAPP_DIR_xxxx=<directory to your xxxx's local.mk file>
执行make。
# Use XCFLAGS to add extra compiler directives for the C compiler
# if you add any please use "XCFLAGS += ..." not "XCFLAGS = "
# unless you're sure you want to override the project defaults.
# Please include a comment if you do this.
#
# XCFLAGS +=
# Use XCXXFLAGS to add extra compiler directives for the C++ compiler.
# See notes above regarding overriding project defaults.
#
# XCXXFLAGS += -DUSE_UNICODE -D_POSIX_PTHREAD_SEMANTICS #-D_POSIX_SOURCE
XCXXFLAGS += $(FLAG_COMPILE_WARNINGS_AS_ERRORS)
# Use XCPPFLAGS to add extra preprocessor directives. Use XINCDIRS
# for other include directories, but please only do this if absolutely
# necessary -- let the makefile system find the include directories if
# possible.
# See notes above regarding overriding project defaults.
#
# XCPPFLAGS +=
# Use XINCDIRS for extra include directories. These should be proceeded
# with "-I" just as they would be when passing to the compiler.
#
# XINCDIRS +=
# Use XLIBDIRS for extra library directories. These should be proceeded
# with "-L" just as they would be when passing to the linker.
# Used for building executables.
#
# XLIBDIRS +=
# Use XLDFLAGS for extra linker directives.
# Used for building executables.
#
# XLDFLAGS +=
如果你要添加lib
假设这里我们要添加一个libtest.so,按一下步骤进行
1,在opencore目录下,新建一个文件夹test,在test目录下添加build目录,在build目录下分别创建android和make两个目录,进入make目录,创建一个新文件local.mk。文件的内容按如下模版进行,也可以去其他的位置copy一份过来:
LOCAL_PATH := $(call get_makefile_dir)
include $(MK)/clear.mk
TARGET := test_lib
XINCDIRS +=
SRCDIR := ../../
INCSRCDIR :=
SRCS := test.c
LIBS
include $(MK)/library.mk
2,在build_config/opencore_dynamic/makefile里include $(MK)/cml2_shared.mk之前一行,加上
TARGET_shared += "test"
SOLIBDIRS_test="/test/build/make"
test_so_name='test'
SOLIBS_test=""
然后执行make,即可。
如果要添加一个可执行程序,local.mk的最后一行写成:include $(MK)/prog.mk
直接在build_config/opencore_dynamic/makefile里更改TESTAPPS
TESTAPPS="pvplayer_engine_test test_pvauthorengine pv2way_omx_engine_test xxxx"
然后加上
TESTAPP_DIR_xxxx=<directory to your xxxx's local.mk file>
执行make。
# Use XCFLAGS to add extra compiler directives for the C compiler
# if you add any please use "XCFLAGS += ..." not "XCFLAGS = "
# unless you're sure you want to override the project defaults.
# Please include a comment if you do this.
#
# XCFLAGS +=
# Use XCXXFLAGS to add extra compiler directives for the C++ compiler.
# See notes above regarding overriding project defaults.
#
# XCXXFLAGS += -DUSE_UNICODE -D_POSIX_PTHREAD_SEMANTICS #-D_POSIX_SOURCE
XCXXFLAGS += $(FLAG_COMPILE_WARNINGS_AS_ERRORS)
# Use XCPPFLAGS to add extra preprocessor directives. Use XINCDIRS
# for other include directories, but please only do this if absolutely
# necessary -- let the makefile system find the include directories if
# possible.
# See notes above regarding overriding project defaults.
#
# XCPPFLAGS +=
# Use XINCDIRS for extra include directories. These should be proceeded
# with "-I" just as they would be when passing to the compiler.
#
# XINCDIRS +=
# Use XLIBDIRS for extra library directories. These should be proceeded
# with "-L" just as they would be when passing to the linker.
# Used for building executables.
#
# XLIBDIRS +=
# Use XLDFLAGS for extra linker directives.
# Used for building executables.
#
# XLDFLAGS +=
相关文章推荐
- Eclipse里面maven项目在没有或移除Maven Dependencies后如何在添加进去
- Cmake系列:如何使用CMake编译自己项目
- VS2008让自己掌控的定义编译项目后,自己主动添加到工具箱
- 如何在Linux下编译Cocos2dx3.11项目(主要是添加源文件喇~)
- 在Cocos2d-x项目中,如何将自己的类添加到Classes文件夹下
- 今天根据自己搭建maven项目的心得,给大家介绍一下maven如何添加依赖jar包
- [FAQ05995] 如何把自己的代码包或开源项目的code, 编译进android D
- Android开发中如何将自己编译的.so文件用到其他的项目中
- 如何在自己的 Android 项目中添加扫一扫功能
- 小记录:如何编译打版本自己的项目
- 如何将android2.1源码添加到自己的项目当中
- Cmake系列:如何使用CMake编译自己项目
- 如何把一个自己写的外部驱动模块编译添加到内核中 来自网络
- 如何在setting里面添加自己的值
- 如何在Android源码编译系统中添加一个Java项目
- Android编译系统如何添加厂商自己定义产品的编译选项
- 如何在编译cocos2d项目加入自己的脚本
- 如何使用自己的makefile编译android ndk项目
- 如何将自己的项目添加Pod
- qtcreator开发环境或者控制台中如何添加自己编译的c/c++库