当前位置:网站首页>Makefile Fundamentals
Makefile Fundamentals
2022-07-02 08:27:00 【Defeat of Fujiwara Qianhua】
What is? Makefile
GNU make (and other variants of make) do precisely this. make defines a language for describing the relationships between source code, intermediate files, and executables. It also provides features to manage alternate configurations, implement reusable libraries of specifications, and parameterize processes with user-defined macros.
In short, make can be considered the center of the development process by providing a roadmap of an application’s components and how they fit together.
GNU make( as well as make Other variants of ) That's what it did .make Defines a method for describing source code 、 The language of the relationship between intermediate files and executable files . It also provides management options 、 Realize the reusable specification library and parameterize the process with user-defined macros .
In short ,make It can be regarded as the center of the development process ( By providing a roadmap for the components of the application and how they are combined ).
Programming mechanisms usually follow a fairly simple process , Edit program source file , Compile the source file into executable form , And debugging results . Here's a C The process of converting source files into executable files :
- The preprocessor : take .c File to .i file , The use of gcc The order is :gcc –E, Corresponds to the preprocessing command cpp;
- compiler : take .c/.h File conversion to .s file , The use of gcc The order is :gcc –S, Corresponding to the compilation command cc –S;
- Assembler : take .s File to .o file , The use of gcc The order is :gcc –c, The corresponding assembly command is as;
- The linker : take .o Convert files into executable programs , The use of gcc The order is : gcc, The corresponding link command is ld;
- loader : Load the executable program into memory and execute ,loader and ld-linux.so.
make Is a build tool , Through analysis makefile The description inside , Compile and build the whole project .
Tips : The following is the main body of this article , The following cases can be used for reference
One 、 Why use Makefile
make There are two main problems to solve :
- Relationship maintenance of a large amount of code
There are many source codes in large projects , Manual maintenance 、 Long compilation time and complex compilation commands , Difficult to remember and maintain
Write the code maintenance command and compilation command in makefile In file , And then use make The tool parses this file and automatically executes the corresponding command , It can realize the reasonable compilation of code
- Reduce repeated compilation time
n When changing one of the files , Can determine which files have been modified , You can recompile only this file , Then re link all the target files , Save compilation time
Two 、Makefile Basic grammar
undetermined
边栏推荐
- 旋转链表(图解说明)
- Media query usage
- Array and string processing, common status codes, differences between PHP and JS (JS)
- Makefile基本原理
- Causes of laptop jam
- Deep understanding of JVM
- Development of digital collection trading website development of metauniverse digital collection
- Cvpr19 deep stacked hierarchical multi patch network for image deblurring paper reproduction
- Global and Chinese markets for Salmonella typhi nucleic acid detection kits 2022-2028: Research Report on technology, participants, trends, market size and share
- Sparse matrix storage
猜你喜欢

c语言自定义类型——结构体,位段(匿名结构体,结构体的自引用,结构体的内存对齐)

乐理基础(简述)

STM32疑难杂症之ST-LINK Connection error INVALID ROM TABLE

顺序表基本功能函数的实现

Web安全--核心防御机制

Static library and dynamic library

On November 24, we celebrate the "full moon"

Fundamentals of music theory (brief introduction)

2022 Heilongjiang latest construction eight members (materialman) simulated examination questions and answers
![[dynamic planning] p4170: coloring (interval DP)](/img/52/76f8baebb19fe10db91c74fec9a697.jpg)
[dynamic planning] p4170: coloring (interval DP)
随机推荐
Use of OpenCV 6.4 median filter
Web安全--核心防御机制
Use the kaggle training model and download your own training model
How to wrap qstring strings
ARP及ARP欺骗
Carsim-问题Failed to start Solver: PATH_ID_OBJ(X) was set to Y; no corresponding value of XXXXX?
Common shortcut keys of Jupiter notebook (you can also view it by pressing h in command mode)
Media query usage
On the back door of deep learning model
文件上传-upload-labs
idea中注释代码取消代码的快捷键
高中数学必修一
c语言自定义类型枚举,联合(枚举的巧妙使用,联合体大小的计算)
STM32疑难杂症之ST-LINK Connection error INVALID ROM TABLE
使用wireshark抓取Tcp三次握手
Use Matplotlib to draw a preliminary chart
HCIA—数据链路层
Matlab数学建模工具
The source code of the live app. When the verification method is mailbox verification, the verification code is automatically sent to the entered mailbox
MySQL optimization