I'm trying to debug my android source build environment (Android.mk files). By default the make system does not show the gcc command line during the build process. What is the best way to enable this?
Overview. The Android.mk file resides in a subdirectory of your project's jni/ directory, and describes your sources and shared libraries to the build system. It is really a tiny GNU makefile fragment that the build system parses once or more.
The 'mm' command makes stuff in the current directory (and sub-directories, I believe). With the 'mmm' command, you specify a directory or list of directories, and it builds those. To install your changes, do 'make snod' from the top of tree. 'make snod' builds a new system image from current binaries.
To compile and debug native code for your app, you need the following components: The Android Native Development Kit (NDK): a set of tools that allows you to use C and C++ code with Android. CMake: an external build tool that works alongside Gradle to build your native library.
Probably too late for the asker, but for anyone else who comes along. From the ndk documentation @ https://docs.google.com/document/d/1jXxLV866aY9QXWS_9UwLSJjX1I6d1XfBhk1IeEyRgYE/edit?pli=1
ndk-build NDK_DEBUG=1 --> generate debuggable native code.
ndk-build V=1 --> launch build, displaying build commands.
ndk-build -B --> force a complete rebuild.
ndk-build -B V=1 --> force a complete rebuild and display build commands.
The showcommands make target will display the gcc/g++ command line:
$ make showcommands
More info and other Android.mk build nuggets here: http://elinux.org/Android_Build_System
If you are building with mm:
$ mm showcommands
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With