自动生成Makefile流程

编译打包和其他
回复
wishs
帖子: 10
注册时间: 2006-10-09 14:05

自动生成Makefile流程

#1

帖子 wishs » 2007-11-23 16:15

源代码为jctx.c
第一步:autoscan 2.60 :
autoscan - Generate a preliminary configure.in
首先如果定义了的话检查SRCDIR,没有则检查当前目录源文件,主要检查常见的移植性问题( common
portability problems)并产生configure.scan 其这是以后generate configure.ac的先决条件之一
autoscan 产生configure.scan 修改并rename 为configure.in
AC_PREREQ(2.60)
AC_INIT(jctx.c)
AM_INIT_AUTOMAKE(jctx, 1.0)
AC_CONFIG_SRCDIR([jctx.c])
第二步:aclocal 1.9.6:
automatically generate aclocal.m4
from configure.in(based on the contents of confiure.in)
aclocal.m4 defined autoconf macros (宏)which will include in automake and can be used in your package
first scan all .m4 file then scans configyre.in . any macros it requres in configure.in and no in the *.m4 will be put into aclocal.m4

第三步:autoconf 2.60:
generate configure script
generate a confiuration script from a template-file if given or configure.ac if present or else configure.in .
output is sent to the standard if template-file is given ,else into 'configure'

第四步:
编辑Makefile.am内容如下:
AUTOMAKE_OPTIONS= foreign
bin_PROGRAMS= jctx
hello_SOURCES= jctx.c

第五步 :automake 1.9.6:
automake --add-missing
加入包装一个软体套件所必备的档案
automatically create makefile.in script from makefile.am

第六步:./configure
generate Makefile
第七步:
make dist make install make clean
附件
auto makefile
auto makefile
头像
windwiny
帖子: 2254
注册时间: 2007-03-13 17:26

#2

帖子 windwiny » 2007-12-01 22:57

很久久久以前发过一个类似的。。。
http://www.linuxsir.org/bbs/showthread. ... highlight= :D
回复