Reputation: 6196
I am working on the contacts app from android open source project. My android version is 2.3.5_r1. And using mm to make the module, but the making speed is quite slow, so i doubt if there is a method to speed up the making.
PS:Actually if i compile this module in eclipse, i will speed up a litter because the auto build feature of eclipse. But i don't like work with eclipse so give it up.
Upvotes: 4
Views: 5505
Reputation: 531
I found that when I use my laptop ssh to my desktop computer and build module, I can build it very very fast. I don't know why.
Upvotes: 0
Reputation: 12301
mmma
is slower than mmm
, as the former make sure all dependencies are met for the module, and if they are not it compiles them as well. So, initially instead of a full make
command, build the dependencies concerning the module you are interested in using the following:
mmma -j4 adir/yourmoduledir
Now that dependencies have met, keep recompiling just the module you are interested in. Skipping check for dependencies saves precious time. The directory you are using though, might contain more than one compilation target. To compile a single target, use something like:
mmm -j4 adir/yourmoduledir:moduletargetname
mmma -j4 art/runtime
Modify libart's code and quickly build it:
mmm -j4 art/runtime:libart
You will get half compilation time in comparison to Yury's approach as for example the debugging flavor of libart
(libartd
) will be omitted altogether.
You should of course enable caching as suggested by aultbot
.
Also, depending on the modules you are interested, there might be compilation targets you might want to disable by digging up in the makefiles. For example libart
is compiled for both the host and the target. If you modify a variable in the makefiles can force compilation just for one of the 2, saving you half of the time.
Checkout out the outdated build guide in aosp: build/core/build-system.html.
N-Preview google is switching to a new build system that aims to speed up incremental builds. I hope the documentation gets updated as well.
Upvotes: 2
Reputation: 803
In order of least cost to you:
export USE_CCACHE=1
. You're only likely to see the effects of CCACHE upon having rebuilt multiple times. If your project is large set a higher CCACHE size e.g. 10GB ${ANDROID_DIR}/prebuilt/linux-x86/ccache/ccache -M 10G
Upvotes: 5
Reputation: 20936
For instance, I use the following command from the root folder of your Android project:
mmm frameworks/base snod -j4
And I think that this is the best choice. Try it but substitute frameworks/base
with your project name (relative path where Android.mk is stored).
Upvotes: 6