14.发布
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_SUBDIRS
,see 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 ‘$(distdir)’ and ‘$(top_distdir)’ are relative to the package where ‘make dist’ was run, not to any sub-packages involved.