qmake, makefile, what is make

qmake is a tool that helps simplify the build process for cross-platform development, one of the tools included with Qt.

qmake can automatically generate Makefile , Microsoft Visual Studio project file and xcode project file. qmake can be used regardless of whether the source code is written in Qt or not, so qmake can be used in the build process of many software.

Writing Makefiles by hand is difficult and error-prone. Especially in cross-platform development, Makefiles must be written separately for different platforms, which will increase the complexity and difficulty of cross-platform development. qmake will automatically generate a Makefile suitable for the platform according to the information in the project file (.pro) . Developers can write their own project files or generate them by qmake itself. qmake includes additional features to facilitate Qt development, such as the automatic inclusion of moc and uic compilation rules.


===============================================================

About makefiles:

There are countless source files in a project, which are placed in several directories by type, function, and module. The makefile defines a series of rules to specify which files need to be compiled first, which files need to be compiled later, and which files need to be compiled. Recompile, and even perform more complex functional operations. Makefile has its own writing format, keywords and functions, just like C language has its own format, keywords and functions. And in the Makefile you can use any command provided by the system shell to do what you want.

The Makefile describes the rules for compiling and linking the entire project. These include: which source files in the project need to be compiled and how to compile, the order of compilation, which library files need to be created and how to create these library files, and how to finally generate the executable file we want. As complicated as it may seem, the benefit of writing a Makefile for a project is the ability to use a single line of commands to do "automated compilation" that, once provided with one (usually multiple for a project) correct Makefile, compiles the entire The only thing you have to do is enter the make command at the shell prompt. The entire project is compiled automatically, which greatly improves the efficiency .

If a programmer in the Linux environment does not use GNU make to build and manage their own projects, they should not be regarded as a qualified professional programmer. Using GNU make tool in Linux (unix) environment can easily build a project of your own. The compilation of the entire project only needs one command to complete the compilation, linking and final execution. But this requires us to invest some time to complete the preparation of one or more files called Makefiles .

make is a command tool, a command tool that interprets the instructions in the makefile. Makefile (may be another file name on other systems) is used in most IDE development environments and has become a project compilation method, such as: Delphi's make, Visual C++'s nmake, GNU under Linux make. It can be seen that makefiles have become a compilation method in engineering.

The benefit of makefile is - "automatic compilation", once it is written, only one make command is needed, and the entire project is completely automatically compiled, which greatly improves the efficiency of software development.

Ref:

https://www.oschina.net/p/qmake

https://baike.baidu.com/item/Makefile/4619787?fr=aladdin

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325758246&siteId=291194637