系统:centos 6.4shell
安装命令:yum install gcc.x86_64centos
查看版本 gcc -vget
使用gcc 编译源文件编译
gcc -c 是编译源文件不连接gcc
gcc -o 是指定输出文件的名称(默认是a.out)
file
例如:gc
gcc -c hello.c ==>生成编译后的文件hello.o(没有连接成可执行文件)yum
gcc hello.o -o hello=>生成可执行文件 hellomakefile
而makefile文件至关因而shell文件(批量执行gcc 命令)tab
语言格式是这样的;
target:A dependencyFile1 dependencyFile2 ...
(tab) commond1
targetB dependencyFile1 dependencyFile2 ...
(tab) commond2