Debugging the Makefile

Some Makefiles contain this -

ifneq ($(call try-cc,$(SOURCE_LIBUNWIND),$(FLAGS_UNWIND),libunwind),y)
        msg := $(warning No libunwind found, disabling post unwind support. Please install libunwind-dev[el] >= 0.99);
        NO_LIBUNWIND := 1

      

and whenever I run this make I get an error like

warning No libunwind found, disabling post unwind support. Please install libunwind-dev[el] >= 0.99

      

I want to debug this problem - want to know the values SOURCE_LIBUNWIND

that FLAGS_UNWIND

are causing this problem - how can I get these values ​​printed to stdout for debugging purposes?

+3


source to share


3 answers


GNU make

provides several features that can be used to print variable values: $(error ...)

, $(warning ...)

and $(info ...)

. The manual mentions them in section 8.12. Functions that make management .



Alternatively, you can use the command line parameter -p

or --print-data-base

to print the values ​​of all rules and variables. Redirecting the output to a file and parsing, which can give you a better idea of ​​why the values ​​are what they are. For more information, see Section 9.7 Parameter Summary .

+4


source


to print the value of the X macro in the makefile - just add the line. (kind of printf)



$ (warning X is $ (X))

+2


source


Rainier and Shraddha have the correct answers to the question asked, but I'm not sure if the correct question was asked.

It seems to me (based on just a snippet of the makefile made) that they are more likely to be variables that you can set than variables that are already set. That is, they will control how you control the location used to find libunwind.

So, if the try-cc call fails, I would assume that it means that you either don't have libunwind installed or you installed in a non-standard system location, and they don't set these variables, do so.

+1


source







All Articles