(1)首先創建一個文件夾,在其中編寫源文件1.c
#include<stdio.h>
int main()
{
printf("hello word!");
return 0;
}
(2)然後gedit Makefile.am產生一個Makefile.am文件,
在其中加入下面這些內容
AUTOMAKE_OPTIONS=foreign
bin_PROGRAMS=main
main_SOURCES=1.c
然後保存
(3)接下來 autoscan 產生configure.scan文件 修改該文件內容
加入下面這句話
AM_INIT_AUTOMAKE(main,1.0)
保存 修改configure.scan後綴名 爲configure.in
(4) 依次執行以下命令(1) aclocal
(2)autoconf
(3)autoheader
(4)automake --add-missing
(5)./configure
(6)make
(7)./main
然後你會大叫 很驚奇的樣子 ,我竟然利用工具生成makefile把 hello word 輸出來了!