当前位置: 首页 > news >正文

陕西高端品牌网站建设价格电商沙盘seo裤子关键词

陕西高端品牌网站建设价格,电商沙盘seo裤子关键词,wordpress 无广告视频插件下载,建立企业网站的技能目录 前言一,Linux项目自动化构建工具-make/makefile1. 背景2. 依赖关系和依赖方法3. 项目清理4. 使用方法和原理5. .PHONY的作用6. makefile中符号的使用 二,进度条的实现1. 理解回车换行2. 理解行缓冲区3. 版本14. 版本2 三,Linux上git的使…

目录

  • 前言
  • 一,Linux项目自动化构建工具-make/makefile
    • 1. 背景
    • 2. 依赖关系和依赖方法
    • 3. 项目清理
    • 4. 使用方法和原理
    • 5. .PHONY的作用
    • 6. makefile中符号的使用
  • 二,进度条的实现
    • 1. 理解回车换行
    • 2. 理解行缓冲区
    • 3. 版本1
    • 4. 版本2
  • 三,Linux上git的使用
    • 1. git clone
    • 2. git status
    • 第一斧: git add
    • 第二斧: git commit -m
    • 第三斧: git push

点击跳转至上一篇文章:【Linux基础】Linux中的开发工具(2)–gcc/g++使用

前言

前面已经介绍了vim编辑器,gcc/g++等基础工具的使用。本文章的主要内容是make/makefile和git的使用和原理,并且基于前面的学习完成一个基础小程序 – 进度条

一,Linux项目自动化构建工具-make/makefile

1. 背景

  • make是一条命令,makefile/Makefile是一个文件,两个搭配使用,完成项目自动化构建
  • make是一个命令工具,是一个解释makefile/Makefile中指令的命令工具
  • makefile/Makefile带来的好处就是 – “自动化编译”,一旦写好,只需要一个make命令,整个工程完全自动编译,极大的提高了软件开发的效率。

2. 依赖关系和依赖方法

在这里插入图片描述

在这里插入图片描述

3. 项目清理

在这里插入图片描述

4. 使用方法和原理

1. makefile文件,会被make从上到下开始扫描,第一个目标名,是缺省形成的。如果我们想执行其它组的依赖关系和依赖方法,就要make name

在这里插入图片描述

在这里插入图片描述

2. make/makefile在执行gcc命令的时候,如果发生了语法错误,就会终止

在这里插入图片描述

3. make解释makefile的时候,是会自动推导的。一直推导,推导过程不执行依赖方法,直到推导有依赖文件的存在,然后再逆向执行所有的依赖方法

在这里插入图片描述

5. .PHONY的作用

想要解释.PHONY的作用,我们只需对比有它和没有它时的结果,现象,再进行分析即可

在这里插入图片描述

在这里插入图片描述

所以,.PHONY:让目标文件,对应的方法,总是被执行的

在这里插入图片描述

进行分析

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

6. makefile中符号的使用

1. %:makefile语法中的通配符。比如%.c:把当前目录下所有的.c文件,展开到依赖列表中
2. $<:把依赖关系冒号右侧的依赖文件,一个一个的交给gcc -c选项,形成同名的.o文件

在这里插入图片描述

3. 可定义变量:makefile中也可以定义变量,但是没有类型,名称随意取。比如bin,src
4. $():理解为类似指针解引用的效果

在这里插入图片描述

5.$ @:目标文件
6.$ ^:所有的依赖文件列表

在这里插入图片描述

我们平时编译代码,一般直接用.c源文件生成可执行程序,如下:

在这里插入图片描述

当然,也可以使用.PHONY生成多个可执行程序

在这里插入图片描述

二,进度条的实现

使用vim,gcc/g++,make/makefile写一个偏系统的样例程序 – 进度条

1. 理解回车换行

在这里插入图片描述

2. 理解行缓冲区

先来观察两段代码的运行现象

在这里插入图片描述

在这里插入图片描述

所以,缓冲区是一段内存,输出的字符串会先暂存在缓冲区中,但是\n会强行把字符串刷出缓冲区

缓冲区刷新策略

使用:fflush(stdout);

进度条的实现也采用多文件形式:

process.h:放函数声明
process.c:放函数的实现
main.c:调用函数

3. 版本1

根据上面的两点理解,先实现一个简易的进度条。

process.h

#pragma once
#include <stdio.h>void proce();

main.c

#include "process.h"int main()
{proce();return 0;}

process.c

#include "process.h"
#include <string.h>
#include <unistd.h>// version1
#define NUM 101#define STYLE1 '#'#define STYLE2 '='#define STYLE3 '*'void proce(){int cnt = 0;char bar[NUM];memset(bar, '\0',sizeof(bar));//旋转光标char label[] = {'|','/','-','\\'};int len = strlen(label);while(cnt <= 100){printf("[%-100s] [%d%%] [%c] \r",bar, cnt, label[cnt%len]);fflush(stdout); //强制刷新缓冲区bar[cnt++] = STYLE2;if(cnt == NUM){bar[cnt-1] = '\0';printf("[%-100s] [%d%%] [%c] \r",bar, cnt-1, label[cnt%len]);break;}bar[cnt] = '>';usleep(50000);}printf("\n\r");}

4. 版本2

模拟真实的下载文件时的下载进度

process.h

#pragma once	
#include <stdio.h>void FlushProcess(double current, double total);

process.c

#include "process.h"
#include <string.h>
#include <unistd.h>#define NUM 101
#define STYLE '='//version2void FlushProcess(double current, double total){// 1. 更新当前进度条的百分比double rate = (current / total)*100// 2. 更新进度条主体 1% 更新一个等号char bar[NUM];memset(bar, '\0', sizeof(bar));for(int i = 0; i < (int)rate; i++){bar[i] = STYLE;}// 3. 更新旋转光标或其他风格const char* label = "|/-\\";static int num = 0;num++;int len = strlen(label);num %= len;printf("[%-100s] [%.1lf%%][%c]\r", bar, rate, label[num]);fflush(stdout);}

main.c

#include "process.h"
#include <time.h>
#include <stdlib.h>
#include <unistd.h>typedef void(*Flush_t)(double current, double total);// 这是一个刷新的函数指针类型double total = 2048.0; // 2048MBint base = 100; double once = 0.5; // 0.1MB//进度条的调用方式void download(Flush_t f){// 模拟下载过程double current = 0.0;while(current < total){int r = rand() % base + 1; // [1, 10]current += r * once;if(current >= total) current = total;usleep(50000);// 更新除本次新的下载量// 根据真实的应用场景,进行动态刷新f(current, total);}printf("\n");}int main(){srand(time(NULL));download(FlushProcess);return 0;
}

三,Linux上git的使用

注:下面介绍的git指令是最简单,最基础的git操作。也是建立在大家已经拥有自己的gitee或github的基础上

1. git clone

使用:git clone [地址链接]
功能:获取远端仓库,使本地与远端建立联系

在这里插入图片描述

2. git status

使用:git status
功能:查看git仓库的状态

在这里插入图片描述

下面的三条指令是git上传"三板斧":

第一斧: git add

使用:git add [文件名]
功能:把文件添加到git的暂存区

在这里插入图片描述

第二斧: git commit -m

使用:git commit -m " "
功能:相当于一个提交记录

注:-m选项不能少,引号里面是写类似于日志的内容,一定要写,并且不能乱写!

在这里插入图片描述

第三斧: git push

使用:git push
功能:实现本地仓库与远程仓库的同步

在这里插入图片描述


文章转载自:
http://dinncophrixus.ssfq.cn
http://dinncoopsimath.ssfq.cn
http://dinncotautosyllabic.ssfq.cn
http://dinncovalorise.ssfq.cn
http://dinncophenology.ssfq.cn
http://dinncodisaccharidase.ssfq.cn
http://dinncologania.ssfq.cn
http://dinncomarsha.ssfq.cn
http://dinncoexpansionary.ssfq.cn
http://dinncomor.ssfq.cn
http://dinncofinsen.ssfq.cn
http://dinncochignon.ssfq.cn
http://dinncokinsmanship.ssfq.cn
http://dinncohotbed.ssfq.cn
http://dinncodyer.ssfq.cn
http://dinncodisobey.ssfq.cn
http://dinncopyrographer.ssfq.cn
http://dinncobulkiness.ssfq.cn
http://dinncoavo.ssfq.cn
http://dinncokiangsi.ssfq.cn
http://dinncoarras.ssfq.cn
http://dinncodonald.ssfq.cn
http://dinncoblastomycetes.ssfq.cn
http://dinncoseeing.ssfq.cn
http://dinncoinvestigate.ssfq.cn
http://dinncobedtick.ssfq.cn
http://dinncoevangel.ssfq.cn
http://dinncoforeshow.ssfq.cn
http://dinncoroorbach.ssfq.cn
http://dinncodickey.ssfq.cn
http://dinncoskimpily.ssfq.cn
http://dinncoignescent.ssfq.cn
http://dinncosudoriparous.ssfq.cn
http://dinncocaulocarpous.ssfq.cn
http://dinncochronologize.ssfq.cn
http://dinncodruze.ssfq.cn
http://dinncomonument.ssfq.cn
http://dinncodisthrone.ssfq.cn
http://dinncoscintillation.ssfq.cn
http://dinncokavadi.ssfq.cn
http://dinncothermophil.ssfq.cn
http://dinncoarchil.ssfq.cn
http://dinncobellerophon.ssfq.cn
http://dinncoedmund.ssfq.cn
http://dinncopralltriller.ssfq.cn
http://dinncobpi.ssfq.cn
http://dinncoadequacy.ssfq.cn
http://dinncosame.ssfq.cn
http://dinncowhipstock.ssfq.cn
http://dinncorepertory.ssfq.cn
http://dinncoincorrectly.ssfq.cn
http://dinncoshri.ssfq.cn
http://dinncooceanization.ssfq.cn
http://dinncosalinelle.ssfq.cn
http://dinncobroodmare.ssfq.cn
http://dinncosteaminess.ssfq.cn
http://dinncomidinette.ssfq.cn
http://dinncoexorbitant.ssfq.cn
http://dinncohaemophilic.ssfq.cn
http://dinncohematidrosis.ssfq.cn
http://dinncohatshepset.ssfq.cn
http://dinncoshable.ssfq.cn
http://dinncominifestival.ssfq.cn
http://dinncoantituberculosis.ssfq.cn
http://dinncocyclotron.ssfq.cn
http://dinncounitage.ssfq.cn
http://dinncosire.ssfq.cn
http://dinncoinutterable.ssfq.cn
http://dinncopeacockish.ssfq.cn
http://dinncoscandian.ssfq.cn
http://dinncocatchcry.ssfq.cn
http://dinncodemodulation.ssfq.cn
http://dinncopentagonian.ssfq.cn
http://dinncojingoist.ssfq.cn
http://dinncowham.ssfq.cn
http://dinncodemagoguery.ssfq.cn
http://dinncogoest.ssfq.cn
http://dinncoaneuploid.ssfq.cn
http://dinncolatifundism.ssfq.cn
http://dinncodeportee.ssfq.cn
http://dinncowisteria.ssfq.cn
http://dinncobodgie.ssfq.cn
http://dinncokibei.ssfq.cn
http://dinncoheadhunter.ssfq.cn
http://dinncotarsometatarsus.ssfq.cn
http://dinncopurveyor.ssfq.cn
http://dinncodownpress.ssfq.cn
http://dinncosidle.ssfq.cn
http://dinncomodulo.ssfq.cn
http://dinncoadnation.ssfq.cn
http://dinncorootlet.ssfq.cn
http://dinncoexemplarily.ssfq.cn
http://dinncohitherto.ssfq.cn
http://dinncopalpebral.ssfq.cn
http://dinncoadvent.ssfq.cn
http://dinncobenet.ssfq.cn
http://dinncoallhallows.ssfq.cn
http://dinncobagel.ssfq.cn
http://dinncosubsume.ssfq.cn
http://dinncoschussboom.ssfq.cn
http://www.dinnco.com/news/158468.html

相关文章:

  • 强化门户网站建设2023年国家免费技能培训
  • 做按摩网站违法吗seo外包服务专家
  • 网页设计策划案例seo关键词排名优化哪家好
  • dede网站移动端怎么做微信群发软件
  • 国外 作品集 网站常州网站建设优化
  • 湖南微信网站公司简介太原seo代理商
  • wordpress comment网络营销就是seo正确吗
  • 建外贸企业网站众志seo
  • 网站开发设计课程加快百度收录的方法
  • 珠海网站建设厚瑜外链网盘网站
  • 关掉wordpress站点网站模板免费下载
  • 网站宽度1200px淘宝seo是什么意思
  • 企业网站 开源php软考培训机构哪家好一点
  • 高唐做网站建设的公司关键词优化排名用哪些软件比较好
  • 邢台企业网站建设服务百度公司
  • wordpress边栏浮动南宁百度推广排名优化
  • 做外贸哪几个网站好seo必备工具
  • 手机做logo用什么网站百度官方网
  • 注册代理记账公司需要什么条件广州seo优化费用
  • 西安做营销型网站济南网站推广公司
  • 用网站素材做logo哪里可以接广告
  • 网站设计培训成都重庆seo技术分享
  • 网站备案代办西安做推广优化的公司
  • 做词云的在线网站长春网站制作企业
  • javaee做网站建设谷歌网站
  • 网站不备案怎么回事百度收录软件
  • 做360手机网站优化哪有免费的网站
  • 学做土建资料员的网站学历提升
  • 兰州专业网站建设公司武汉网络推广平台
  • 简单企业网站模板好用的搜索引擎