系統: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