14.发布

本系列文章均翻译自Automake官方文档:Automake Manual,github同步项目:question

14.1 发布基础

可以发布多种格式的发布包,不只有tar.gz。

发布包含的文件:

  • 所有的源文件,Makefilea.am和Makefile.in也会进去
  • Automake内置的常用文件列表,可以通过automake --help查看
  • 一些特定条件下产生的文件(比如*AC_CONFIG_HEADERS([config.h])*产出的 config.h.top and config.h.bot文件)
  • 被configure准备的文件
  • Makefile.am中使用include列出的文件、configure.ac中使用m4_include列出的文件???
  • automake --add-missing安装的帮助脚本

一些文件不会被规则所包含,可以在EXTRA_DIST中指定这些文件(夹)。指定文件夹时可能不会想要例如私有文件夹.svn被包含,可以使用特性as-is,也可以使用disk-hook特性来改善这个问题。see The dist Hook

SUBDIRS也会递归的包含子目录。可以设置条件,see Conditionals。如果需要有条件的指定一系列目录,可以设置DIST_SUBDIRSsee Conditional Subdirectories

14.3 The dist Hook

在打包之前改变。在发布文件夹被填充之后、实际发布档案被创建之前运行。

EXTRA_DIST = doc
dist-hook:
        rm -rf `find $(distdir)/doc -type d -name .svn`

该规则不会认为文件是可写的,所以需要改变文件内容时,添加想应的权限。

(distdir)指向当前文件夹;$(top_distdir)指向根目录。

Note:when packages are nested using AC_CONFIG_SUBDIRS (see Subpackages), then ‘ ( d i s t d i r ) a n d (distdir)’ and ‘ (top_distdir)’ are relative to the package where ‘make dist’ was run, not to any sub-packages involved.

猜你喜欢

转载自blog.csdn.net/SHRINKSHR/article/details/85838984