自动生成Makefile文件模板

Step by Step

1, autoscan

2, move configure.scan to configure.ac, and vim configure.ac like this:

AM_INIT_AUTOMAKE(myprojectname , version)

AC_OUTPUT(Makefile  subdir/Makefile subdir1/Makefile)

AC_PROG_RANLIB

3, aclocal : a perl script

4, autoconf -fvi

5, make Makefile.am, as:

bin_PROGRAMS=myprogram
SUBDIRS=sub1

myprogram_SOURCES= \
a.cpp \
b.cpp

EXTRA_DIST= \
a.h \
b.h

myprogram_LDADD = libsub1.a

myprogram_LDFLAGS = -lpthread -lglib-2.0 -L/usr/bin $(all_libraries)

AM_CXXFLAGS = -D_LINUX

INCLUDES=-IPassport -Isub1/ -I/usr/include/glib-2.0 \
-I/usr/lib/glib-2.0/include $(all_includes)

6, autoheader declare config.h.in

7, automake --add-missing

8, ./configure

9, make

10, example:

template.tar.gz

you can run the script name of rmlocal, and try it .

author:cnangel


Categories

,
| | 评论(0)

Post a comment

关于此日记

此日记由Cnangel发表于2008年3月 9日 10:13

此Blog上的上一篇日记和何伟平老师的一番谈话

此Blog上的下一篇日记介绍一款目录对比工具——Meld

主索引归档页可以看到最新的日记和所有日记。

2008年8月

Sun Mon Tue Wed Thu Fri Sat
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            
Powered by Movable Type 4.21-zh-cn