73

I'm trying to print some extra info when in compile a library using ndk-build.

For example:

LOCAL_PATH := $(call my-dir)
all:;echo $(LOCAL_PATH)
echo: $(LOCAL_PATH)
print:echo "i'm not working"

When i do ndk-build, just compile all the Android.mk, but i don't get the console echo. I have readed the GNU make info (ndk-build is just a tiny GNU make), and some post whom said echo must work using a $(VAR) but it's not working on my case.

Some idea?

vgonisanz
  • 11,831
  • 13
  • 78
  • 130

3 Answers3

133

Use

LOCAL_PATH := $(call my-dir)
$(warning $(LOCAL_PATH))
Andrey Kamaev
  • 29,582
  • 6
  • 94
  • 88
57

The more correct function to call is "$(info ...)" :

LOCAL_PATH := $(call my-dir)
$(info $(LOCAL_PATH))
slaadvak
  • 4,611
  • 1
  • 24
  • 34
nellute
  • 846
  • 7
  • 5
  • 1
    Just an advise, using $(info) I had some compilation issues that make my compilation fail in Windows but not in Linux, just for someone experiment problem adding info. I started using CMake compilation to the detriment of Android.mk because work better – vgonisanz Dec 12 '13 at 11:16
31

The following displays are available in Android.mk:

  • error: debug print + stop the build
  • info: basic debug print
  • warning: same as info but displays the line number where it's been inserted

Here below some samples:

$(error this is the error message that will stop the build process)
$(warning this the warning msg)
$(info this the info msg)
PedroSw7
  • 339
  • 3
  • 4