Tuesday, January 03, 2012

How to add logs into android.mk [to display the information at compile time]

How to add logs into android.mk file:
 
This log will be printed whenever we are compiling.
Usecases: In a large project, somewhere the values will be set, User wont be aware of it.
So that time,to print which device macro is enabled, we can make use of this warning in android.mk

within Android.mk,

ENABLE_CODEC =1
ifeq(ENABLE_CODEC,true)
$(warning SUNDARA::ENABLE_CODEC is true)
else
$(warning SUNDARA::ENABLE_CODEC is false)
endif

#How to print the variable from Android.mk

TARGET_PLATFORM := MSM7227
$(warning SUNDARA::Target Plarform is '$(TARGET_PLATFORM)')

output:
SUNDARA::ENABLE_CODEC is true
Target Plarform is MSM7227

No comments: