4

Generally, is there any steps/tricks to speed up the android build, apart from -jN option. Even for a single line change in kernel, running 'make bootimage', the android build system scans all Android.mk. Any ways to skip this at least ?

CodeWarrior
  • 5,026
  • 6
  • 30
  • 46
Balamurugan A
  • 1,886
  • 2
  • 17
  • 19

4 Answers4

4

By referring build/core/Makefile, It shows that, we can see the sequence of commands running while building by passing SHOW_COMMANDS=1 while building Android as below,

SHOW_COMMANDS=1 V=1 make bootimage -j1 -n >bootimage.txt 

From this we can extract the commands which are necessary for our case, and we can put into a script to build. eg, bootimage.sh

Balamurugan A
  • 1,886
  • 2
  • 17
  • 19
1

Here you can find a summary of speedup methods: http://oldwiki.cyanogenmod.org/wiki/Howto:_Speed_up_building

Use an SSD and a strong 16GB RAM linux machine(not VM).

There is also the idea of RAM drive which is crazy fast, but I am not sure if its possible with the amount of space android needs for the build.

skoperst
  • 2,259
  • 1
  • 23
  • 35
0

As the Balamurugan A's answers said,

If you invoke make target(module name/droid), the Android compile system will scan all Android.mk for loading and searching target. This is the make system needing to do to find all target for following compiling.

If you only want to compile one module, you can use mm/mmm. And if you want to increase the speed of compiling for the system, you can open CCache.

QJGui
  • 907
  • 8
  • 10
  • ,Yes. "If you invoke make target(module name/droid), the Android compile system will scan all Android.mk for loading and searching target". How to avoid scanning? And, I think on mmm and CCache, same was already suggested by skoperst and i replied him too. – Balamurugan A Jun 30 '14 at 05:48
  • @BalamuruganA Thanks for your suggestion. And here, I want to give more information about CCache. :-) – QJGui Jun 30 '14 at 15:10
0

For building just the kernel this saved me a ton of time in Android L,M,N:-

m -j8 ONE_SHOT_MAKEFILE=build/target/board/Android.mk bootimage

Zakir
  • 2,222
  • 21
  • 31