I’m having a problem with building an Android ROM (galaxys2att, gingerbread). I decided it was time to get smarter about makefile processing. So I created a simple test project to play with. But it’s not getting compiled. Here’s what I did:
1 I create a directory (“myproject/“) under a buildable module (I used “Mms/” but others had the same problem).
2 I create Android.mk in that directory containing
hello:
echo "Hello from myproject"
(I have no blank line between hello: and echo: the page editor added these)
3 I ran mm in the “Mms/” directory.
Mms and other subproject compiled but no evidence of myproject.
Android.mk in Mms contained line
include $(call all-makefiles-under, $(LOCAL_PATH))
Of course I ran envsetup.sh originally.
What am I missing here?
In the Android NDK, there’s some documentation in
.../docs/ANDROID-MK.html. Unfortunately, there’s not much other documentation to find, beside looking into existing makefiles. A minimalAndroid.mkfor building a shared library, might look like thisAn
Android.mkis not like a regular Makefile. You have a boilerplate, define some variables needed in sub makefiles and then do the work by including predefined Android makefiles.BUILD_SHARED_LIBRARY, for example, is defined inbuild/core/build-all.mkaswhich itself defines and checks some make variables and then includes
$(BUILD_SYSTEM)/build-module.mk, and so on.Inside build-all.mk, there are other variables defined as well, like
BUILD_HOST_EXECUTABLE,BUILD_STATIC_LIBRARYorBUILD_EXECUTABLE, which are used to build a static library or an executable.