苏嵌 学习日志 吴浩南 2018.07.11

 

今日学习任务

 

1了解项目管理的方法及重要性;(项目代码目录结构)

2熟练掌握 makefile 基本语法的使用;(目标、依赖、命令)

3企业级 makefile 的编写;(迭代开发)

4、了解 git/github 的使用;(学会管理代码)

今日任务完成情况

 

(详细说明本日任务是否按计划完成,开发的代码量)

今日任务基本按照老师计划完成,但是在课程开始时对于上节课的知识提问存在理解、记忆问题。

今日开发中出现的问题汇总

 

c语言基础太差,程序编写有困难。

 

 

今日未解决问题

 

 

今日开发收获

学习了用gdb调试;

学习了如何编写makefilemakefile语法三要素:目标体、依赖体、命令。

 

 

自我评价

 

(是否按开发规范完成既定任务,需要改进的地方,与他人合作效果等)

 

 

基本上能够跟上老师的讲课节奏,但是目前出现了很多需要记忆理解的指令操作,不能在课上走思,否则很容易跟不上节奏,会导致后期学习出现知识断点问题。

其他

 


#include<stdio.h>
int fuction(int a )
{
    return a*a;
}
int main()
{
    int i;
    int sum=0;
    for(i=0;i<=100;i++)
    {
        sum = sum + i;
    }
    int result = fuction(3);
    printf("result = %d\n",result);
    printf("sum = %d\n",sum);
    return 0;
}

 

#include<stdio.h>
int main()
{
    printf("add = %d\n",add(6,3));
    printf("sub = %d\n",sub(6,3));
    printf("mul = %d\n",mul(6,3));
    printf("div = %d\n",div(6,3));
    return 0;
}
    int add(int a, int b)
{
    return a + b;

}

int sub(int a, int b)
{
    return a - b;

}

 

int mul(int a, int b)
{
    return a * b;

}

 

int div(int a, int b)
{
    return a / b;

}

 


 

scriptsMakefile

 

  1 CC := gcc
  2 CFLAGS := -Wall -O3
  3 Libs = -lpthread
  4 Target := client
  5 Source := $(wildcard src/*.c)
  6 Objs := $(patsubst %.c,%.o,$(Source))
  7 Modules += add sub mul div main

  8 AllObjs := $(addsuffix /src/*.o,$(Modules))

 

 

主控Makefile

 

  1 include scripts/Makefile
  2 
  3 modules_make = $(MAKE) -C $(1);
  4 modules_clean = $(MAKE) clean -C $(1);
  5 
  6 .PHONY: all mm mc clean
  7 
  8 all: $(Target)
  9 
 10 mm:
 11         @ $(foreach n,$(Modules),$(call modules_make,$(n)))
 12 mc:
 13         @ $(foreach n,$(Modules),$(call modules_clean,$(n)))
 14 
 15 $(Target) : mm
 16         $(CC) $(CFLAGS) -o $(Target) $(AllObjs) $(Libs)
 17         @ echo $(Target) make done!
 18 
 19 clean : mc

 20         rm -rf $(Target)

 

 

子目录Makefile

 

  1 include ../scripts/Makefile
  2 
  3 all : $(Objs)
  4 
  5 clean : 

  6         rm -rf $(Objs)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值