Pageviews

Saturday, November 9, 2013

How to Make a single module (shared library) for AOSP.

According to the AOSP homepage, we learned that we could build the whole aosp source tree using:
$: make -j4
the command will generate a /out directory for storing all compiled resources.

This command normally takes about 40mins - 1hr for compiling depends on the CPU.
but if you just want to modify a single library, ex a libOmxVdec.so which is used for decoding videos.

1, go to /hardware/qcom/media/mm-video/vidc/vdec/
    this is the source file that generates the libOmxVdec.so, you should be able to find a Android.mk file, open it up, you can find a line says:
                  LOCAL_MODULE := libOmxVdec
   basically, it tells the compile to generate a shared library named after this name.

2, to make this component and not the whole source tree, simply type:
$: mmm
please use command "hmm" for the help messages, basically this command tells the compiler to builds all of the modules in the supplied directories, but not their dependencies.
The generated .so file and other resources will be generated and get transferred to the corresponding location in /out directory.

*Sometimes, the compiler will complain there is nothing to make, that's because /out directly already have a existing .so file with the same name. to do the make clean for this specific component.
$: mmm -B

As always, you are welcome!