Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to see the actual gcc options when building Android from source?

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?

like image 373
hopia Avatar asked Apr 09 '11 21:04

hopia


People also ask

What is .MK file in Android?

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.

What is Android mm command?

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.

What is NDK build?

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.


2 Answers

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.

like image 111
Jerry F Avatar answered Oct 05 '22 02:10

Jerry F


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
like image 24
hopia Avatar answered Oct 05 '22 04:10

hopia