当前位置:网站首页>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
边栏推荐
- Force deduction method summary: find classes
- Programming ape learning English - imperative programming
- High school mathematics compulsory one
- Opencv common method source link (continuous update)
- 路由基础—动态路由
- Sparse matrix storage
- 类和对象(类和类的实例化,this,static关键字,封装)
- Jumping | Blue Bridge Cup
- Matlab other
- Carsim-问题Failed to start Solver: PATH_ID_OBJ(X) was set to Y; no corresponding value of XXXXX?
猜你喜欢
Matlab mathematical modeling tool
Vs code configuration problem
Use Matplotlib to draw a preliminary chart
CarSim learning experience - rough translation 1
Hcia - Application Layer
When a custom exception encounters reflection
How to back up the configuration before the idea when reinstalling the idea
Carla-UE4Editor导入RoadRunner地图文件(保姆级教程)
Use the kaggle training model and download your own training model
CarSim problem failed to start solver: path_ ID_ OBJ(X) was set to Y; no corresponding value of XXXXX?
随机推荐
OpenCV关于x,y坐标容易混淆的心得
sqli-labs(POST类型注入)
Realize bidirectional linked list (with puppet node)
How to back up the configuration before the idea when reinstalling the idea
Matlab - autres
Mutex
Carsim-问题Failed to start Solver: PATH_ID_OBJ(X) was set to Y; no corresponding value of XXXXX?
HCIA—應用層
Implementation of bidirectional linked list (simple difference, connection and implementation between bidirectional linked list and unidirectional linked list)
How to wrap qstring strings
力扣每日一题刷题总结:链表篇(持续更新)
链表经典面试题(反转链表,中间节点,倒数第k个节点,合并分割链表,删除重复节点)
2022 Heilongjiang latest food safety administrator simulation exam questions and answers
W10 is upgraded to W11 system, but the screen is black, but the mouse and desktop shortcuts can be used. How to solve it
The best blog to explain the basics of compilation (share)
HCIA—应用层
What are the platforms for selling green label domain names? What is the green label domain name like?
Web安全--核心防御机制
CarSim learning experience - rough translation 1
web安全--逻辑越权