gnu make: list the values of all variables (or “macros”) in a particular run

后端 未结 6 1482
面向向阳花
面向向阳花 2020-12-07 16:41

How can I list the current value of all variables (also called macros) in a Makefile when running make?

E.g. if this is in the Makefile:

CUR-DIR := $         


        
6条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-07 17:24

    Thanks to @kevinf for the great idea. I would suggest a minor change to prevent .VARIABLE itself from printing out in the variable list:

    $(foreach v, $(filter-out .VARIABLES,$(.VARIABLES)), $(info $(v) = $($(v))))

提交回复
热议问题