androidmakefileandroid-sourceandroid-make

Add a make rule to the main make of AOSP


I've added a new C++ subproject at frameworks/base/cmds/myproject and it has its own Android.mk file. When I run make myproject, it'll compile well and no problem.

However I want to add make myproject to the main make. I mean, when someone runs make at the root of AOSP, my project to be included as well. What should I do?


Solution

  • You need your Android.mk file to be called. There are various ways to do so, depending on your needs.

    If you want your myproyect to be compiled for several of the devices you have under device/, then look for a common mk file. For example this is how Qualcomm does it, you can copy it for AOSP.

    If you want it just for a specific device:

    Watch out for correct indentation.

    This way, when you do source build/envsetup.sh and lunch mini_emulator_x86-user and then make, your myproyect.mk will be reached.

    In order to test it:

    For additional reference you may take a look at how Qualcomm organizes their device folder, with common and base mk files. Take a look at their open source code here