当前位置:网站首页>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
边栏推荐
- Simple implementation scheme of transcoding and streaming (I)
- Summary of one question per day: stack and queue (continuously updated)
- CarSim problem failed to start solver: path_ ID_ OBJ(X) was set to Y; no corresponding value of XXXXX?
- Global and Chinese market of electric cheese grinder 2022-2028: Research Report on technology, participants, trends, market size and share
- C language implements XML generation and parsing library (XML extension)
- Implementation of bidirectional linked list (simple difference, connection and implementation between bidirectional linked list and unidirectional linked list)
- Common shortcut keys of Jupiter notebook (you can also view it by pressing h in command mode)
- HCIA—数据链路层
- Installation and use of simple packaging tools
- Media query usage
猜你喜欢

Generate database documents with one click, which can be called swagger in the database industry

Carsim-問題Failed to start Solver: PATH_ID_OBJ(X) was set to Y; no corresponding value of XXXXX?

Carla-ue4editor import Roadrunner map file (nanny level tutorial)

什么是SQL注入

HCIA—应用层

Carsim-问题Failed to start Solver: PATH_ID_OBJ(X) was set to Y; no corresponding value of XXXXX?

Linked list classic interview questions (reverse the linked list, middle node, penultimate node, merge and split the linked list, and delete duplicate nodes)

Development of digital collection trading website development of metauniverse digital collection

sqli-labs(POST类型注入)

How to build the alliance chain? How much is the development of the alliance chain
随机推荐
c语言将字符串中的空格替换成%20
文件上传-upload-labs
Force buckle method summary: sliding window
sqli-labs(POST类型注入)
Comparison between setTimeout and requestanimationframe (page refresh)
ICMP协议
力扣每日一题刷题总结:栈与队列篇(持续更新)
Installation and use of simple packaging tools
Global and Chinese market of medicine cabinet 2022-2028: Research Report on technology, participants, trends, market size and share
Web安全--核心防御机制
Global and Chinese market of electric cheese grinder 2022-2028: Research Report on technology, participants, trends, market size and share
Deep understanding of JVM
Use Matplotlib to draw a preliminary chart
用数字 5,5,5,1 ,进行四则运算,每个数字当且仅当用一次,要求运算结果值为 24
Global and Chinese market of snow sweepers 2022-2028: Research Report on technology, participants, trends, market size and share
Principes fondamentaux de la théorie musicale (brève introduction)
Network security - summary and thinking of easy-to-use fuzzy tester
Matlab other
CarSim learning experience - rough translation 1
Development of digital collection trading website development of metauniverse digital collection