How to view the value of a variable in makfile

Source: Internet
Author: User

Checking the value of a variable in makefile should be a very troublesome problem, but this is a very convenient method developed by the great god himself. This method is very simple. The introduction is as follows:

If a variable src_file is used in a very complicated and huge MAKEFILE file, you 'd like to know the value of this variable when makefile runs here. Then you can write two lines below this variable:

$ (Shell echo $ (src_file)> readme.txt)

Rrrrrrrrrrrrrrrrrrr

The first line is actually to call the shell command to input the value of this variable into the README variable. The shell command in makefile is executed first than the rule command, so it can certainly be run here. The "rrrrrrrrrrrrrrrrrrrrrrrrrrr" in the second line is actually a production error. Because some makefiles have been executed for a long time, we just want to know the value of the variable src_file, you do not need to execute the complete makefile again. Therefore, if you add a incorrectly formatted code to the second line, the makefile will exit after executing the shell command.

This is complete!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.