Foreword:
First of all, I would like to pay my most sincere tribute to Chen Hao , the author of the article "Write Makefile with Me" . His article on makefile learning is of great help to my study. At the same time, I pay tribute to the champions of open source projects. The following article is the notes made while studying the makefile with "Writing Makefile with Me" as the reference document. It has been condensed. The complete "Writing Makefile with Me" is posted here:
github:https://github.com/seisman/how-to-write-makefile
1. Summary
There are countless source files in a project, which are placed in several directories according to type, function, and module. 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 rebuilt. Compile, and even perform more complex functional operations, because the makefile is like a Shell script and can also execute operating system commands.
The biggest benefit of Makefile for developers is automatic compilation.
It is very convenient to use make in Linux system. You can install it with the command sudo apt-get install make, provided that your system has installed the apt tool and can access the Internet normally.
If you use make in Windows, just install the make-x.xx.exe program.
Learning materials:
1) "Write a makefile with me": https://github.com/seisman/how-to-write-makefile
2)《GUN make manual》 :http://www.gnu.org/software/make/manual/make.html
Next, the introductory learning of makefile will be summarized in the following chapters:
- Summary of Makefile introductory knowledge-overview
- Summary of Makefile introductory knowledge 2: The composition of makefile
- Summary of Makefile introductory knowledge three --- core rules of makefile
- Summary of Makefile introductory knowledge four ---analysis of the working mechanism of makefile
- Makefile introductory knowledge summary five --- basic grammar
- Summary of Makefile entry knowledge six---common operators
- Makefile introductory knowledge summary seven --- the use of variables
- Makefile introductory knowledge summary eight---the use of conditional judgment
- Makefile introductory knowledge summary nine --- commonly used functions
Through the above learning summary, I hope it will be helpful to you who are learning makefile, ^-^!