利用automake工具自动生成makefile[总结]
2009-10-15 11:08
381 查看
看了一些网上的资料,然后自己总结了一下:
kernel:2.6.27.30-170.2.82_ND5_1.i686.PAE
1.you should create your source code by hand.
e.g. you can write a simple code, like main.c"main(void) {}";
2.use the command autoscan, this command will generate two files:autoscan.log, configure.scan;
3.next step is the most important, you should change the name of the configure.scan instead of configure.in;
and then edit the file configure.in, you should place the FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS in your own definations, and the most important step is to add a sentence "AM_INIT_MAKE(PACKAGE-NAME, VERSION)" into configure.in, and replace the AC_OUTPUT to AC_OUTPUT([Makefile])
4.use aclocal to generate the "aclocal.m4" and "autom4te.cache", these files are used to deine the local marco
5.use autoconf to generate the configure file
6.use autoheader to generate the config.h.in.This tool is used to copy the additional symbols from user usually, if you do not add the additional symbols, then you needn't execute this command.
7.Before automake.
Create a new file Makefile.am, this file will be used by automake command. It's the configuration files, and we need create it by self.
The content like the following:
-----------------------------
AUTOMAKE_OPTIONS=foreign
bin_PROGRAMS=bin-name
bin-name_SOURCES=sourcecode
-----------------------------
==========================================================================
Tip:
1).the AUTOMAKE_OPTION can used to configure the automake, the 'foreign' means only check the requires file. another is 'gnits', the default is 'gnu'. If default, you should create these files 'COPYING,NEWS,INSTALL,README' and so on;
2).bin_PROGRAMS used to define the execute filename, if you have a lot, you should use space to split them. for example: bin_PROGRAMS=a b c
3).exec-name_SOURCES to define the source code that can be used to generate the exec-name. If the target exec-name needs 1.c 1.h, then you should write like this: exec-name_SOURCES=1.c 1.h
==========================================================================
Caution: if you define a lot exe-names, you should write the exe-name_SOURCES for each.
for a instance, bin_PROGRAMS=a b c
a_SOURCES=a.c
b_SOURCES=b.c
c_SOURCES=c.c
8.use automake to generate the Makefile.in
#automake --add-missing
option '--add-missing' let automake add the requires scripts when running.
9.Verify, use ./configure to generate the Makefile.
10.test it. #make && make install
kernel:2.6.27.30-170.2.82_ND5_1.i686.PAE
1.you should create your source code by hand.
e.g. you can write a simple code, like main.c"main(void) {}";
2.use the command autoscan, this command will generate two files:autoscan.log, configure.scan;
3.next step is the most important, you should change the name of the configure.scan instead of configure.in;
and then edit the file configure.in, you should place the FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS in your own definations, and the most important step is to add a sentence "AM_INIT_MAKE(PACKAGE-NAME, VERSION)" into configure.in, and replace the AC_OUTPUT to AC_OUTPUT([Makefile])
4.use aclocal to generate the "aclocal.m4" and "autom4te.cache", these files are used to deine the local marco
5.use autoconf to generate the configure file
6.use autoheader to generate the config.h.in.This tool is used to copy the additional symbols from user usually, if you do not add the additional symbols, then you needn't execute this command.
7.Before automake.
Create a new file Makefile.am, this file will be used by automake command. It's the configuration files, and we need create it by self.
The content like the following:
-----------------------------
AUTOMAKE_OPTIONS=foreign
bin_PROGRAMS=bin-name
bin-name_SOURCES=sourcecode
-----------------------------
==========================================================================
Tip:
1).the AUTOMAKE_OPTION can used to configure the automake, the 'foreign' means only check the requires file. another is 'gnits', the default is 'gnu'. If default, you should create these files 'COPYING,NEWS,INSTALL,README' and so on;
2).bin_PROGRAMS used to define the execute filename, if you have a lot, you should use space to split them. for example: bin_PROGRAMS=a b c
3).exec-name_SOURCES to define the source code that can be used to generate the exec-name. If the target exec-name needs 1.c 1.h, then you should write like this: exec-name_SOURCES=1.c 1.h
==========================================================================
Caution: if you define a lot exe-names, you should write the exe-name_SOURCES for each.
for a instance, bin_PROGRAMS=a b c
a_SOURCES=a.c
b_SOURCES=b.c
c_SOURCES=c.c
8.use automake to generate the Makefile.in
#automake --add-missing
option '--add-missing' let automake add the requires scripts when running.
9.Verify, use ./configure to generate the Makefile.
10.test it. #make && make install
相关文章推荐
- 利用Linux下自动生成makefile的工具: automake, autoconf 生成makefile的一般过程
- 关于automake等工具自动生成Makefile文件的一些技术摘要
- ubuntu10.04下,利用automake工具生成Makefile
- 利用autoconf和automake来自动生成MakeFile
- 用automake工具自动生成Makefile的实例
- 利用工具自动生成makefile文件
- 利用 autoconf 和 automake 自动生成Makefile
- 自动生成makefile的工具?GNU Automake;cmake;
- 运用autoconf和automake自动生成Makefile实例
- 利用autotool自动生成Makefile
- WebService学习总结 三 利用本地wsdl文档生成客户端代码和TCP/IP工具监听请求
- Makefile自动生成工具
- 运用autoconf和automake自动生成Makefile实例讲解
- automake:自动生成makefile文件
- 利用libtool自动生成动态库的Makefile的生成方法
- 【转】运用autoconf和automake自动生成Makefile实例讲解
- linux环境下利用autotools工具自动生成make file
- automake自动生成makefile
- automake和autoconf自动生成Makefile
- Makefile自动生成工具-----autotools的使用(详细)