问题描述
我正在尝试在AOSP的外部目录中构建自己的库和应用程序,但是问题是我每次都必须运行make,并且make会编译/构建整个android.在我的外部应用程序文件夹中,我有Android.mk文件,但是我无法使用ndk-build进行构建,它将查找JNI文件夹和NDK_BUILD_PATH,因此问题是:
I am trying to build my own libs and apps in external directory of the AOSP, but the problem is i have to run make each time and the make will compile/build whole the android.In my external apps folder i have Android.mk file, but i cannot build it using ndk-build, it will look for JNI folder and NDK_BUILD_PATH, so the question is:
如何在不重建整个AOSP的情况下构建它?
How can i build it without rebuilding whole AOSP?
推荐答案
简单的make
调用不会重建超过必要的数量,但是即使使用叶子库或二进制文件,甚至增量构建也可能需要几分钟.如果只想构建特定的模块,则可以查看build/envsetup.sh顶部简要记录的功能.具体来说,m
和mm
shell函数应该很有用,因为它们仅构建一个或多个模块而无需关心它们的依赖性,甚至不尝试读取树中找到的所有Android.mk文件.使用它们应该可以显着加快增量构建的速度(但所有依赖项必须已在某个时刻构建,即,它们仅对增量构建有用).
A plain make
invocation will not rebuild more than necessary, but even with a leaf library or binary even an incremental build can take a few minutes. If you only want to build your particular module you can look at the functions briefly documented at the top of build/envsetup.sh. Specifically, the m
and mm
shell functions should be useful as they only build one or more modules without caring about their dependencies and without even trying to read all Android.mk files found in the tree. Using them should speed up incremental builds significantly (but all dependencies must have been built at some point, i.e. they're only useful for incremental builds).
build/envsetup.sh还定义了许多其他Shell函数,这些函数对于构建Android平台和使用其源代码很有用.
build/envsetup.sh also defines a number of other shell functions that are useful for building the Android platform and working with its source code.
这篇关于如何构建Android AOSP的一部分?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!