Chinaunix首页 | 论坛 | 博客
  • 博客访问: 512023
  • 博文数量: 235
  • 博客积分: 1209
  • 博客等级: 少尉
  • 技术积分: 1417
  • 用 户 组: 普通用户
  • 注册时间: 2011-11-19 19:59
文章分类

全部博文(235)

文章存档

2012年(107)

2011年(128)

分类:

2011-12-01 00:05:23

原文地址:automake的简单使用 作者:bingzheaaa

单层目录:
 顺序:
  手写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
阅读(502) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~