Generate Makefile Using Qmake

Source: Internet
Author: User

Manual writing Makefile is a painful thing, a little careless will be wrong, but qmake can let you out of misery

Qmake can generate makefile based on the . Pro file that you provide.

I want some more . Pro File Yes! , but he's a lot simpler than makefile, and you can learn it in a minute.

simple. Pro file
SOURCES + = Hello. CPP  + =  hello.hconfig+ = cnosole warn_on Debug

Only configure these three items to generate makefile

SOURCES

Writes out the location of the source file, supports relative paths, supports wildcard characters

SOURCES =.. /SRC/*. cpp

Sources uses = overwrites previously assigned values, so it is recommended to use + =

HEADERS

Write the location of the header file, using the same way as sources

HEADERS + =. /SRC/*. h
CONFIG

The configuration options for program compilation are defined here, for example:

Console represents the Build console program

WARN_ON represents open warning

Debug is compiled on behalf of debug mode and can also be used with release

Generate makefile

Generate Makefile Using Qmake

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.