Linux project automated build tool-make/makefile; git version management tool

一.make && makefile

1. Make automated interpreter, makefile is a file

2. Interpret the makefile through make to build an executable program

3. The rules of the makefile file
• Target object: what executable program needs to be generated, or the target program (.o)
• Dependent object: When generating the target object, the dependent file
• Compilation command: How to use the dependent object to generate the target

4. Makefile file format:
Insert picture description here
Insert picture description here
5. Make explains the principles of makefile. If you want to generate multiple target objects, you can do as follows: 6. Predefined variables $^: all dependent objects $@: target objects 7. Makefile cleanup: Want to Delete the generated target object -> clean 8. Variables can also be customized in the makefile
make解释器在解释makefile的时候,会对比依赖对象(源文件)和目标对象(可执行程序)的生成时间
如果目标对象(可执行程序)生成的时间距离现在较近,说明目标对象是最新的,不需要重新编译
(time - 目标对象的生成时间) < (time - 依赖对象的生成时间)
如果依赖对象(源文件)生成的时间距离现在比较近,说明依赖对象(源码文件)更改过,需要重新编译
(time - 目标对象的生成时间) > (time - 依赖对象的生成时间)

Insert picture description here
make只为生成第一个目标对象,一旦make解释生成了第一个目标对象,则停止解释
Insert picture description here
make解释器在解释makefile的时候,为了生成第一个目标对象,也会判断第一个目标对象依赖的对象是否存在,
如果不存在,则会在makefile后续的语句当中查找生成依赖对象的方法,先将依赖对象生成,在使用依赖对象,
将第一个目标对象生成


Insert picture description here



Insert picture description here

Insert picture description here

Insert picture description here

2. Git version management tool

1. Clone the warehouse

git clone "repository url"
Insert picture description here

2. Upload

2.1 Mark: Tell the git tool to manage those files

git add [filename]/*

2.2 Submit to the local warehouse

git commit -m "Submit log and why upload"

2.3 Push to remote warehouse

git push origin master

3. Delete the content in the warehouse

Local warehouse content + remote warehouse content
git rm "file"
git commit -m "commit log"
git push origin master

4. Download the source code from the remote warehouse

git pull

Guess you like

Origin blog.csdn.net/weixin_50886514/article/details/114552632