A simple description to makefile.

Source: Internet
Author: User

Because the company needs to program in Linux, I have been spoiled by windows for a long time, so I think that it is difficult for programmers to become small files.

There are many makefile tutorials on the Internet, so I will not detail them here. Go to Dongdong to ask Baidu and Google.

 

The following shows a simple sample. mk file.

Get started with makefile.

 

Test. mk

 

# Ifndef ver
Ver: = all
# Endif

Clear:
@ If [$ (VER) = "debug"]; then/
Rm-RF Debug. Out ;/
Fi
@ If [$ (VER) = "release"]; then/
Rm-RF release. Out ;/
Fi
@ If [$ (VER) = "all"]; then/
Rm-RF Debug. Out ;/
Rm-RF release. Out ;/
Fi
@ Echo --- finish clear ---;

 

Run the following command line:

Make-F test. mk

In this case, the variable ver is set to all.

The following two commands are executed.

Rm-RF Debug. Out ;/
Rm-RF release. Out ;/

 

Of course, you can also enter the ver to the value in the command line:

Make-F test. mk ver = release

 

In this way, you can input different Ververs to the command line to perform different operations.

 

Note that the line where the command description is located must start with a Tab character.

Otherwise, the make command cannot recognize the command.

 

 

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.