国产91精品在线播放,欧美精品在线免费,日韩中文字幕在线有码视频网

上海校區切換校區
圖標

學習文章

當前位置:首頁 > >學習文章 > >

{紅帽 RHCE} Makefile

發布時間: 2018-05-16 19:45:09

[root@server0 maketest2]# cat foo.c addnum.c

#include<stdio.h>

extern int addnumbers(int a,int b);

int main()

{

   int sum;

   int x=5;

   int y=8;

   sum=addnumbers(x,y);

   printf("sum of %d and %d is %d\n",x,y,sum);

   return 0;

}

#include<stdio.h>

int addnumbers(int a,int b)

{

   int sum;

   sum=a+b;

   return sum;

}

[root@server0 maketest2]# gcc -o foo foo.c addnum.c

[root@server0 maketest2]# ll

-rw-r--r--. 1 root root   83 Apr 12 03:06 addnum.c

-rwxr-xr-x. 1 root root 8579 Apr 12 03:14 foo

-rw-r--r--. 1 root root  177 Apr 12 03:13 foo.c

[root@server0 maketest2]# ./foo

sum of 5 and 8 is 13



[root@server0 maketest2]# cat Makefile

hello: foo.o addnum.o

   gcc -o hello foo.o addnum.o


foo.o: foo.c

   gcc -c foo.c


addnum.o: addnum.c

   gcc -c addnum.c


clean:

   rm -f *.o hello


[root@server0 maketest2]# make

gcc -c foo.c

gcc -c addnum.c

gcc -o hello foo.o addnum.o


[root@server0 maketest2]# ./hello

sum of 5 and 8 is 13

上一篇: {思科 CCNA-RS}EIGRP的簡介

下一篇: {紅帽RHCE}CentOS7 搭建LVS+keepalived負載均衡(二)

在線咨詢 ×

您好,請問有什么可以幫您?我們將竭誠提供最優質服務!

<menuitem id="vlare"></menuitem>

    <ul id="vlare"><rp id="vlare"><optgroup id="vlare"></optgroup></rp></ul>

  • 主站蜘蛛池模板: 安泽县| 增城市| 五家渠市| 太湖县| 会理县| 绵阳市| 惠东县| 浏阳市| 肃南| 安岳县| 肥城市| 九江县| 高雄市| 南陵县| 垫江县| 丁青县| 晋州市| 乌兰浩特市| 广西| 静乐县| 咸阳市| 壤塘县| 泸溪县| 吉水县| 祁门县| 通河县| 隆子县| 临澧县| 都兰县| 丘北县| 卓资县| 泸定县| 伊金霍洛旗| 晋宁县| 潞城市| 崇左市| 蒲江县| 九江市| 静乐县| 凤庆县| 招远市|