Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android.mk debug output

I am building Froyo, is it possible that during building, make/python can output the file and the command it is calling right now.

For example, in one of the Android.mk, there is a line, says, echo build success. On the monitor it will show "build success", what I want is that in addition, it shows "Android.mk line 20: echo build success".

Is it possible?

like image 338
Jimmy Avatar asked Oct 19 '25 14:10

Jimmy


2 Answers

The message parser of the android make comment accepts info and warning tags in your Android.mk.

For example, If you want to print the value of an internal variable:

LOCAL_CFLAGS := -DHAVE_ERRNO_H -g
$(info value of LOCAL_CFLAGS is: $(LOCAL_CFLAGS))

the info tells the compiler to print info debug output.

You can do the same with warning and error

$(warning value of LOCAL_CFLAGS is: $(LOCAL_CFLAGS))

would print a highlighted warning message

and

$(error value of LOCAL_CFLAGS is: $(LOCAL_CFLAGS))

would print the message and stop the build.

like image 72
Dyonisos Avatar answered Oct 21 '25 04:10

Dyonisos


I've just experienced an odd effect of using $(info) when compiling a java+C++ Android application:

I used $info) to output some informations about conditional compiling in the Android.mk of the main application and when trying to debug the native part of the program, using ndk-gdb, it failed because apparently the output of $(info) is read by the ndk-gdb script (using the get_build_var() and get_build_var_for_abi() functions). THe result is that the ndk-gdb script is not executed properly.

like image 21
Marco Avatar answered Oct 21 '25 04:10

Marco