How to print out a variable in makefile

后端 未结 15 1082
臣服心动
臣服心动 2020-12-07 06:51

In my makefile, I have a variable \'NDK_PROJECT_PATH\', my question is how can I print it out when it compiles?

I read Make file echo displaying "$PATH" st

15条回答
  •  情话喂你
    2020-12-07 07:17

    You could create a vars rule in your make file, like this:

    dispvar = echo $(1)=$($(1)) ; echo
    
    .PHONY: vars
    vars:
        @$(call dispvar,SOMEVAR1)
        @$(call dispvar,SOMEVAR2)
    

    There are some more robust ways to dump all variables here: gnu make: list the values of all variables (or "macros") in a particular run.

提交回复
热议问题