当前位置:网站首页>makefile基础学习
makefile基础学习
2022-08-04 05:30:00 【Btobk】
Makefile 工程文件
严格的规则,格式
1.为什么需要makefile
1)工程的配置文件,工程管理,减少工作量,多个文件汇总到一个文件,只用执行make就行
2)Make命令依赖于makefile文件,否则会提示找不到规则
3)会告诉make命令如何编辑,如何执行代码
2.格式
目标:依赖
命令
命令前面有一个tab键
*hello:hello.c
gcc hello.c-o hello
在当前目录下需要有:hello.c,makefile
引入变量机制:cc = gcc,简化流程,防止以后改编译器
Hello:hello.c
$(cc) hello.c -o hello
3.自动变量
[email protected]:代表所有目标
$<:代表第一个依赖
$^:代表所有的依赖
cc = gcc
Hello:hello.c
$(cc) $^ -o [email protected]
4.隐式规则
vim makefile
使用make执行,【-f】可以指定文件(除默认文件)【v】,【n】,【s】,【w】,【C】【help】
【clean】清除
5.模式规则
可以全部编译,也可以指定一个文件进行编译
%类似余*,每一个.c,每一个.o
6.备注
之前的错了,我真的服了
边栏推荐
- Deep Learning Theory - Initialization, Parameter Adjustment
- 卷积神经网络入门详解
- MNIST handwritten digit recognition, sorted by from two to ten
- MNIST Handwritten Digit Recognition - Lenet-5's First Commercial Grade Convolutional Neural Network
- Pytorch问题总结
- MOOSE平台官方第二个例子分析——关于创建Kernel,求解对流扩散方程
- Copy攻城狮5分钟在线体验 MindIR 格式模型生成
- TensorRT 5 初步认识
- PP-LiteSeg
- 详解近端策略优化
猜你喜欢
代码庆端午--粽你心意
Deep Learning Theory - Initialization, Parameter Adjustment
Deep Learning Theory - Overfitting, Underfitting, Regularization, Optimizers
AIDL communication between two APPs
[Deep Learning Diary] Day 1: Hello world, Hello CNN MNIST
Polynomial Regression (PolynomialFeatures)
【Copy攻城狮日志】“一分钟”跑通MindSpore的LeNet模型
Introduction of linear regression 01 - API use cases
浅谈外挂常识和如何防御
AWS使用EC2降低DeepRacer的训练成本:DeepRacer-for-cloud的实践操作
随机推荐
审稿意见回复
DeblurGAN-v2: Deblurring (Orders-of-Magnitude) Faster and Better 图像去模糊
度量学习(Metric learning、损失函数、triplet、三元组损失、fastreid)
详解近端策略优化
周志华机器学习
光条中心提取方法总结(一)
Copy攻城狮的年度之“战”|回顾2020
No matching function for call to ‘RCTBridgeModuleNameForClass‘
图像线性融合
MNIST手写数字识别 —— 图像分析法实现二分类
Unity ML-agents 参数设置解明
PostgreSQL schema (Schema)
PP-LiteSeg
【CV-Learning】Image Classification
Image-Adaptive YOLO for Object Detection in Adverse Weather Conditions
强化学习中,Q-Learning与Sarsa的差别有多大?
双向LSTM
MOOSE平台使用入门攻略——如何运行官方教程的例子
MNIST手写数字识别 —— Lenet-5首个商用级别卷积神经网络
AWS uses EC2 to reduce the training cost of DeepRacer: DeepRacer-for-cloud practical operation