单层目录:
顺序:
手写Makefile.am(包括顶层目录和源码目录)
autoscan,生成configure.scan
mv configure.scan configure.in
修改configure.in
acloal && autoheader
创建必要文件:README, NEWS, AUTHORS, ChangeLog
automake -a
autoconf
多层目录:
实例:
test
|
|----src
| |----comm
| | |----print.h
| | |----print.c
| | |----Makefile.am(1)
| |----main.c
| |
| |----Makefile.am(2)
|
|----Makefile.am(3)
1,手写
Makefile.am(3):
SUBDIRS = src
Makefile.am(2):
SUBDIRS = comm
bin_PPROGRAMs = print
print_SOURCES = main.c
print_LDADD = comm/print.o
Makefile.am(1):
noinst_PROGRAMS = appprint
appprint_SOURCES = print.c print.h
DEFS = -D_GNU_SOURCE
2,autoscan生成configure.scan,
mv configure.scan configure.in
修改configure.in
3,aclocal && autoheader
4,创建必要文件:README, NEWS, AUTHORS, ChangeLog
5,automake -a
修改comm下的Makefle.in
找到类似于
…….
clean-noinstPROGRAMS:
-test -z "$(noinst_PROGRAMS)"
rm -f $(noinst_PROGRAMS)
apple$(EXEEXT): $(apple_OBJECTS) $(apple_DEPENDENCIES)
@rm -f apple$(EXEEXT)
#$(LINK) $(apple_LDFLAGS) $(apple_OBJECTS) $(apple_LDADD) $(LIBS)------注释掉这一行
…….
6,autoconf
阅读(526) | 评论(0) | 转发(0) |