How to print out a variable in makefile

后端 未结 15 1090
臣服心动
臣服心动 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条回答
  •  旧时难觅i
    2020-12-07 07:27

    from a "Mr. Make post" https://www.cmcrossroads.com/article/printing-value-makefile-variable

    Add the following rule to your Makefile:

    print-%  : ; @echo $* = $($*)
    

    Then, if you want to find out the value of a makefile variable, just:

    make print-VARIABLE
    

    and it will return:

    VARIABLE = the_value_of_the_variable
    

提交回复
热议问题